Bug 1181520 - Remove support for passing in reftest arguments via the command line, r=jmaher
☠☠ backed out by 5a8d86582839 ☠ ☠
authorJames Graham <james@hoppipolla.co.uk>
Thu, 13 Aug 2015 13:04:58 +0100
changeset 294579 29c33bbaac01f1741c653b46e706f67bb24d71c5
parent 294535 a9275e9bbcb438e941d65b7328b8ff50ae77fecf
child 294580 da3dd2f650d0f664dfaf1d67754b1f8db99ef66c
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1181520
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1181520 - Remove support for passing in reftest arguments via the command line, r=jmaher This unifies how reftests are invoked across desktop and mobile, and paves the way for introducing more complex datatypes that are unreasonable to express on the command line.
layout/tools/reftest/reftest-cmdline.js
layout/tools/reftest/reftest.js
layout/tools/reftest/runreftest.py
--- a/layout/tools/reftest/reftest-cmdline.js
+++ b/layout/tools/reftest/reftest-cmdline.js
@@ -16,47 +16,16 @@ RefTestCmdLineHandler.prototype =
 {
   classID: Components.ID('{32530271-8c1b-4b7d-a812-218e42c6bb23}'),
 
   /* nsISupports */
   QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler]),
 
   /* nsICommandLineHandler */
   handle : function handler_handle(cmdLine) {
-    var args = { };
-    args.wrappedJSObject = args;
-    try {
-      var uristr = cmdLine.handleFlagWithParam("reftest", false);
-      if (uristr == null)
-        return;
-      try {
-        args.uri = cmdLine.resolveURI(uristr).spec;
-      }
-      catch (e) {
-        return;
-      }
-    }
-    catch (e) {
-      cmdLine.handleFlag("reftest", true);
-    }
-
-    try {
-      var nocache = cmdLine.handleFlag("reftestnocache", false);
-      args.nocache = nocache;
-    }
-    catch (e) {
-    }
-
-    try {
-      var skipslowtests = cmdLine.handleFlag("reftestskipslowtests", false);
-      args.skipslowtests = skipslowtests;
-    }
-    catch (e) {
-    }
-
     /* Ignore the platform's online/offline status while running reftests. */
     var ios = Components.classes["@mozilla.org/network/io-service;1"]
               .getService(Components.interfaces.nsIIOService2);
     ios.manageOfflineStatus = false;
     ios.offline = false;
 
     /**
      * Manipulate preferences by adding to the *default* branch.  Adding
@@ -73,17 +42,17 @@ RefTestCmdLineHandler.prototype =
 
 #include reftest-preferences.js
 
     var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
                            .getService(nsIWindowWatcher);
 
     function loadReftests() {
       wwatch.openWindow(null, "chrome://reftest/content/reftest.xul", "_blank",
-                        "chrome,dialog=no,all", args);
+                        "chrome,dialog=no,all", {});
     }
 
     var remote = false;
     try {
       remote = prefs.getBoolPref("reftest.remote");
     } catch (ex) {
     }
 
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -445,17 +445,16 @@ function Shuffle(array)
         array[i] = array[j];
         array[j] = temp;
     }
 }
 
 function StartTests()
 {
     var uri;
-#if BOOTSTRAP
     /* These prefs are optional, so we don't need to spit an error to the log */
     try {
         var prefs = Components.classes["@mozilla.org/preferences-service;1"].
                     getService(Components.interfaces.nsIPrefBranch);
     } catch(e) {
         gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | EXCEPTION: " + e + "\n");
     }
 
@@ -482,34 +481,16 @@ function StartTests()
     } catch(e) {
         uri = "";
     }
 
     if (uri == "") {
         gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | Unable to find reftest.uri pref.  Please ensure your profile is setup properly\n");
         DoneTests();
     }
-#else
-    try {
-        // Need to read the manifest once we have gHttpServerPort..
-        var args = window.arguments[0].wrappedJSObject;
-
-        if ("nocache" in args && args["nocache"])
-            gNoCanvasCache = true;
-
-        if ("skipslowtests" in args && args.skipslowtests)
-            gRunSlowTests = false;
-
-        uri = args.uri;
-    } catch (e) {
-        ++gTestResults.Exception;
-        gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | | EXCEPTION: " + ex + "\n");
-        DoneTests();
-    }
-#endif
 
     if (gShuffle) {
         gNoCanvasCache = true;
     }
 
     try {
         ReadTopManifest(uri);
         BuildUseCounts();
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -200,16 +200,17 @@ class RefTest(object):
             prefs['reftest.logFile'] = options.logFile
         if options.ignoreWindowSize:
             prefs['reftest.ignoreWindowSize'] = True
         if options.filter:
             prefs['reftest.filter'] = options.filter
         if options.shuffle:
             prefs['reftest.shuffle'] = True
         prefs['reftest.focusFilterMode'] = options.focusFilterMode
+        prefs['reftest.uri'] = "file://%s" % os.path.abspath(manifest)
 
         # Ensure that telemetry is disabled, so we don't connect to the telemetry
         # server in the middle of the tests.
         prefs['toolkit.telemetry.enabled'] = False
         prefs['toolkit.telemetry.unified'] = False
         # Likewise for safebrowsing.
         prefs['browser.safebrowsing.enabled'] = False
         prefs['browser.safebrowsing.malware.enabled'] = False
@@ -605,17 +606,17 @@ class RefTest(object):
         if options.debugger:
             debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs,
                                                       options.debuggerInteractive)
 
         profileDir = None
         try:
             reftestlist = self.getManifestPath(testPath)
             if cmdlineArgs == None:
-                cmdlineArgs = ['-reftest', reftestlist]
+                cmdlineArgs = []
             profile = self.createReftestProfile(options, reftestlist)
             profileDir = profile.profile  # name makes more sense
 
             # browser environment
             browserEnv = self.buildBrowserEnv(options, profileDir)
 
             log.info("REFTEST INFO | runreftest.py | Running tests: start.\n")
             status = self.runApp(profile,