Bug 1323399 - Fix the stylo-vs-gecko reftest harness. r=heycam
authorShing Lyu <shing.lyu@gmail.com>
Wed, 14 Dec 2016 15:44:39 +0800
changeset 326902 c4fa2b29abe7220545789fa2706601338cbe90aa
parent 326901 ac71e73d904d69cf77c264333694a5b5e07e2159
child 326903 99365c0b73478e57a5936c45ae2bebcf765fcd78
push id35387
push userslyu@mozilla.com
push dateThu, 22 Dec 2016 10:06:54 +0000
treeherderautoland@c4fa2b29abe7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1323399
milestone53.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 1323399 - Fix the stylo-vs-gecko reftest harness. r=heycam MozReview-Commit-ID: 7htc3KOGGl6
layout/tools/reftest/reftest.jsm
testing/mozharness/configs/unittests/linux_unittest.py
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -50,16 +50,17 @@ var gTotalChunks = 0;
 var gThisChunk = 0;
 var gContainingWindow = null;
 var gURLFilterRegex = {};
 var gContentGfxInfo = null;
 const FOCUS_FILTER_ALL_TESTS = "all";
 const FOCUS_FILTER_NEEDS_FOCUS_TESTS = "needs-focus";
 const FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS = "non-needs-focus";
 var gFocusFilterMode = FOCUS_FILTER_ALL_TESTS;
+var gCompareStyloToGecko = false;
 
 // "<!--CLEAR-->"
 const BLANK_URL_FOR_CLEARING = "data:text/html;charset=UTF-8,%3C%21%2D%2DCLEAR%2D%2D%3E";
 
 var gBrowser;
 // Are we testing web content loaded in a separate process?
 var gBrowserIsRemote;           // bool
 var gB2GisMulet;                // bool
@@ -405,16 +406,22 @@ function InitAndStartRefTests()
         gTotalChunks = 0;
         gThisChunk = 0;
     }
 
     try {
         gFocusFilterMode = prefs.getCharPref("reftest.focusFilterMode");
     } catch(e) {}
 
+#ifdef MOZ_STYLO
+    try {
+        gCompareStyloToGecko = prefs.getBoolPref("reftest.compareStyloToGecko");
+    } catch(e) {}
+#endif
+
     gWindowUtils = gContainingWindow.QueryInterface(CI.nsIInterfaceRequestor).getInterface(CI.nsIDOMWindowUtils);
     if (!gWindowUtils || !gWindowUtils.compareCanvases)
         throw "nsIDOMWindowUtils inteface missing";
 
     gIOService = CC[IO_SERVICE_CONTRACTID].getService(CI.nsIIOService);
     gDebug = CC[DEBUG_CONTRACTID].getService(CI.nsIDebug2);
 
     RegisterProcessCrashObservers();
@@ -1308,20 +1315,31 @@ function StartCurrentTest()
 
 function StartCurrentURI(aState)
 {
     gState = aState;
     gCurrentURL = gURLs[0]["url" + aState].spec;
 
     RestoreChangedPreferences();
 
+    var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+        getService(Components.interfaces.nsIPrefBranch);
+
+    if (gCompareStyloToGecko) {
+        if (gState == 2){
+            logger.info("Disabling Servo-backed style system");
+            prefs.setBoolPref('layout.css.servo.enabled', false);
+        } else {
+            logger.info("Enabling Servo-backed style system");
+            prefs.setBoolPref('layout.css.servo.enabled', true);
+        }
+    }
+
     var prefSettings = gURLs[0]["prefSettings" + aState];
     if (prefSettings.length > 0) {
-        var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                    getService(Components.interfaces.nsIPrefBranch);
         var badPref = undefined;
         try {
             prefSettings.forEach(function(ps) {
                 var oldVal;
                 if (ps.type == PREF_BOOLEAN) {
                     try {
                         oldVal = prefs.getBoolPref(ps.name);
                     } catch (e) {
--- a/testing/mozharness/configs/unittests/linux_unittest.py
+++ b/testing/mozharness/configs/unittests/linux_unittest.py
@@ -221,17 +221,18 @@ config = {
             "tests": ["tests/reftest/tests/layout/reftests/reftest.list"]
         },
         "reftest-no-accel": {
             "options": ["--suite=reftest",
                         "--setpref=layers.acceleration.force-enabled=disabled"],
             "tests": ["tests/reftest/tests/layout/reftests/reftest.list"]},
         "reftest-stylo": {
             "options": ["--suite=reftest",
-                        "--disable-e10s"],
+                        "--disable-e10s",
+                        "--setpref=reftest.compareStyloToGecko=true"],
             "tests": ["tests/reftest/tests/layout/reftests/reftest-stylo.list"],
         },
     },
     "all_xpcshell_suites": {
         "xpcshell": {
             "options": ["--xpcshell=%(abs_app_dir)s/" + XPCSHELL_NAME,
                         "--manifest=tests/xpcshell/tests/xpcshell.ini"],
             "tests": []