layout/tools/reftest/b2g_start_script.js

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 function setDefaultPrefs() {
     6     // This code sets the preferences for extension-based reftest.
     7     var prefs = Cc["@mozilla.org/preferences-service;1"].
     8                 getService(Ci.nsIPrefService);
     9     var branch = prefs.getDefaultBranch("");
    11 #include reftest-preferences.js
    12 }
    14 function setPermissions() {
    15   if (__marionetteParams.length < 2) {
    16     return;
    17   }
    19   let serverAddr = __marionetteParams[0];
    20   let serverPort = __marionetteParams[1];
    21   let perms = Cc["@mozilla.org/permissionmanager;1"]
    22               .getService(Ci.nsIPermissionManager);
    23   let ioService = Cc["@mozilla.org/network/io-service;1"]
    24                   .getService(Ci.nsIIOService);
    25   let uri = ioService.newURI("http://" + serverAddr + ":" + serverPort, null, null);
    26   perms.add(uri, "allowXULXBL", Ci.nsIPermissionManager.ALLOW_ACTION);
    27 }
    29 // Load into any existing windows
    30 let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
    31             .getService(Ci.nsIWindowMediator);
    32 let win = wm.getMostRecentWindow('');
    34 // Set preferences and permissions
    35 setDefaultPrefs();
    36 setPermissions();
    38 // Loading this into the global namespace causes intermittent failures.
    39 // See bug 882888 for more details.
    40 let reftest = {};
    41 Cu.import("chrome://reftest/content/reftest.jsm", reftest);
    43 // Start the reftests
    44 reftest.OnRefTestLoad(win);

mercurial