browser/components/tabview/test/browser_tabview_bug628165.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/components/tabview/test/browser_tabview_bug628165.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +function test() {
     1.8 +  let cw;
     1.9 +
    1.10 +  let testEnableSearchWithWindowsKey = function () {
    1.11 +    let utils = cw.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
    1.12 +                  .getInterface(Components.interfaces.nsIDOMWindowUtils);
    1.13 +
    1.14 +    // we test 0, for Linux, and 91 (left) and 92 (right) for windows
    1.15 +    let keyCodes = [0, 91, 92];
    1.16 +    keyCodes.forEach(function(keyCode) {
    1.17 +      utils.sendKeyEvent("keydown", keyCode, 0, 0);
    1.18 +      ok(!cw.Search.isEnabled(), "search is not enabled with keyCode: " + keyCode);
    1.19 +    });
    1.20 +    
    1.21 +    hideTabView(finish);
    1.22 +  }
    1.23 +
    1.24 +  waitForExplicitFinish();
    1.25 +
    1.26 +  showTabView(function () {
    1.27 +    cw = TabView.getContentWindow();
    1.28 +    testEnableSearchWithWindowsKey();
    1.29 +  });
    1.30 +}

mercurial