Bug 1341927. Fix the stylo reftest setup to set prefs via the normal mechanism and hence not run afoul of the reftest harness canvas caching. r=heycam
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 22 Feb 2017 19:30:57 -0500
changeset 344347 4939b26390ddd3303531359e03e3953c0691b354
parent 344346 d26eb1db5b1c4b9cec29a75c3d2e893dbd3b3e78
child 344348 d47255dae628cd97b6262f9b36b63abf6b8f8eeb
push id37821
push userbzbarsky@mozilla.com
push dateThu, 23 Feb 2017 02:38:05 +0000
treeherderautoland@4939b26390dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1341927
milestone54.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 1341927. Fix the stylo reftest setup to set prefs via the normal mechanism and hence not run afoul of the reftest harness canvas caching. r=heycam MozReview-Commit-ID: 9XlVwTV964w
layout/reftests/writing-mode/tables/reftest-stylo.list
layout/tools/reftest/reftest.jsm
--- a/layout/reftests/writing-mode/tables/reftest-stylo.list
+++ b/layout/reftests/writing-mode/tables/reftest-stylo.list
@@ -66,18 +66,18 @@ asserts(1-2) == vertical-table-specified
 
 # HTTP(../..) == s72-border-spacing-002.xht s72-border-spacing-002.xht
 # HTTP(../..) == s72-border-spacing-003.xht s72-border-spacing-003.xht
 # HTTP(../..) == s72-border-spacing-004.xht s72-border-spacing-004.xht
 # HTTP(../..) == s72-border-spacing-005.xht s72-border-spacing-005.xht
 fails == wm-row-progression-002.xht wm-row-progression-002.xht
 fails == wm-row-progression-003.xht wm-row-progression-003.xht
 fails == wm-row-progression-004.xht wm-row-progression-004.xht
-== wm-row-progression-004.xht wm-row-progression-005.xht
-== wm-row-progression-004.xht wm-row-progression-006.xht
+fails == wm-row-progression-005.xht wm-row-progression-005.xht
+fails == wm-row-progression-006.xht wm-row-progression-006.xht
 fails == wm-row-progression-007.xht wm-row-progression-007.xht
 
 # == table-caption-top-1.html table-caption-top-1.html
 # == table-caption-bottom-1.html table-caption-bottom-1.html
 # == table-caption-left-1.html table-caption-left-1.html
 # == table-caption-right-1.html table-caption-right-1.html
 
 fuzzy-if(stylo,1,7400) == border-collapse-bevels-1a.html border-collapse-bevels-1a.html
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -840,16 +840,24 @@ function AddTestItem(aTest, aFilter)
     if (aTest.url2 !== null)
         aTest.identifier = [aTest.prettyPath, aTest.type, aTest.url2.spec];
     else
         aTest.identifier = aTest.prettyPath;
 
     gURLs.push(aTest);
 }
 
+function AddStyloTestPrefs(aSandbox, aTestPrefSettings, aRefPrefSettings)
+{
+    AddPrefSettings("test-", "layout.css.servo.enabled", "true", aSandbox,
+                    aTestPrefSettings, aRefPrefSettings);
+    AddPrefSettings("ref-", "layout.css.servo.enabled", "false", aSandbox,
+                    aTestPrefSettings, aRefPrefSettings);
+}
+
 // Note: If you materially change the reftest manifest parsing,
 // please keep the parser in print-manifest-dirs.py in sync.
 function ReadManifest(aURL, inherited_status, aFilter)
 {
     // Ensure each manifest is only read once. This assumes that manifests that are
     // included with an unusual inherited_status or filters will be read via their
     // include before they are read directly in the case of a duplicate
     if (gManifestsLoaded.hasOwnProperty(aURL.spec)) {
@@ -874,16 +882,20 @@ function ReadManifest(aURL, inherited_st
     inputStream.close();
     var lines = streamBuf.split(/\n|\r|\r\n/);
 
     // Build the sandbox for fails-if(), etc., condition evaluation.
     var sandbox = BuildConditionSandbox(aURL);
     var lineNo = 0;
     var urlprefix = "";
     var defaultTestPrefSettings = [], defaultRefPrefSettings = [];
+    if (gCompareStyloToGecko) {
+        AddStyloTestPrefs(sandbox, defaultTestPrefSettings,
+                          defaultRefPrefSettings);
+    }
     for (var str of lines) {
         ++lineNo;
         if (str.charAt(0) == "#")
             continue; // entire line was a comment
         var i = str.search(/\s+#/);
         if (i >= 0)
             str = str.substring(0, i);
         // strip leading and trailing whitespace
@@ -908,16 +920,20 @@ function ReadManifest(aURL, inherited_st
             while ((item = items.shift())) {
                 if (!(m = item.match(gPrefItemRE))) {
                     throw "Unexpected item in default-preferences list in manifest file " + aURL.spec + " line " + lineNo;
                 }
                 if (!AddPrefSettings(m[1], m[2], m[3], sandbox, defaultTestPrefSettings, defaultRefPrefSettings)) {
                     throw "Error in pref value in manifest file " + aURL.spec + " line " + lineNo;
                 }
             }
+            if (gCompareStyloToGecko) {
+                AddStyloTestPrefs(sandbox, defaultTestPrefSettings,
+                                  defaultRefPrefSettings);
+            }
             continue;
         }
 
         var expected_status = EXPECTED_PASS;
         var allow_silent_fail = false;
         var minAsserts = 0;
         var maxAsserts = 0;
         var needs_focus = false;
@@ -1316,26 +1332,16 @@ 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 badPref = undefined;
         try {
             prefSettings.forEach(function(ps) {
                 var oldVal;
                 if (ps.type == PREF_BOOLEAN) {
                     try {