B2G/gecko/browser/components/tabview/test/browser_tabview_bug628165.js
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */
Any copyright is dedicated to the Public Domain.
Any copyright is dedicated to the Public Domain .
function test() {
  let cw;
  let testEnableSearchWithWindowsKey = function () {
    let utils = cw.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                  .getInterface(Components.interfaces.nsIDOMWindowUtils);
    let keyCodes = [0, 91, 92];
    keyCodes.forEach(function(keyCode) {
      utils.sendKeyEvent("keydown", keyCode, 0, 0);
      ok(!cw.Search.isEnabled(), "search is not enabled with keyCode: " + keyCode);
    });
    hideTabView(finish);
  }
  waitForExplicitFinish();
  showTabView(function () {
    cw = TabView.getContentWindow();
    testEnableSearchWithWindowsKey();
  });
}
function test ( ) { let cw ; let testEnableSearchWithWindowsKey = function ( ) { let utils = cw . QueryInterface ( Components . interfaces . nsIInterfaceRequestor ) . getInterface ( Components . interfaces . nsIDOMWindowUtils ) ; let keyCodes = [ 0 , 91 , 92 ] ; keyCodes . forEach ( function ( keyCode ) { utils . sendKeyEvent ( "keydown" , keyCode , 0 , 0 ) ; ok ( ! cw . Search . isEnabled ( ) , "search is not enabled with keyCode: " + keyCode ) ; } ) ; hideTabView ( finish ) ; } waitForExplicitFinish ( ) ; showTabView ( function ( ) { cw = TabView . getContentWindow ( ) ; testEnableSearchWithWindowsKey ( ) ; } ) ; }
Any copyright is dedicated to the Public Domain.
Any copyright is dedicated to the Public Domain .
// we test 0, for Linux, and 91 (left) and 92 (right) for windows