B2G/gecko/testing/mochitest/browser-test.js
// This code allows us to redirect without requiring specialpowers for chrome and a11y tests.
This code allows us to redirect without requiring specialpowers for chrome and a11y tests.
This code allows us to redirect without requiring specialpowers for chrome and a11y tests .
function messageHandler(m) {
      messageManager.removeMessageListener("chromeEvent", messageHandler);
      var url = m.json.data;
      var webNav = content.window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                         .getInterface(Components.interfaces.nsIWebNavigation);
      webNav.loadURI(url, null, null, null, null);
    }
function messageHandler ( m ) { messageManager . removeMessageListener ( "chromeEvent" , messageHandler ) ; var url = m . json . data ; var webNav = content . window . QueryInterface ( Components . interfaces . nsIInterfaceRequestor ) . getInterface ( Components . interfaces . nsIWebNavigation ) ; webNav . loadURI ( url , null , null , null , null ) ; }
This code allows us to redirect without requiring specialpowers for chrome and a11y tests.
This code allows us to redirect without requiring specialpowers for chrome and a11y tests .
// Window is the [ChromeWindow] for messageManager, so we need content.window  // Currently chrome tests are run in a content window instead of a ChromeWindow