Bug 1344132 - Make reftest run stylo-vs-gecko test without special reftest.list. r=dbaron draft
authorShing Lyu <slyu@mozilla.com>
Fri, 03 Mar 2017 14:21:58 +0800
changeset 563923 0806d1717e35bd390124cd2e413e48d50236af99
parent 556622 ec8d1d3db50c85037e8077c32c8403570a5df493
child 624624 f3b6915471309aeb5e774c43c9920bdc89732797
push id54471
push userbmo:slyu@mozilla.com
push dateTue, 18 Apr 2017 03:45:15 +0000
reviewersdbaron
bugs1344132
milestone55.0a1
Bug 1344132 - Make reftest run stylo-vs-gecko test without special reftest.list. r=dbaron MozReview-Commit-ID: 3XqZGNoqG2h
layout/tools/reftest/reftest.jsm
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -760,21 +760,29 @@ function AddPrefSettings(aWhere, aPrefNa
     } else if (valType == "number" && (parseInt(prefVal) == prefVal)) {
         prefType = PREF_INTEGER;
     } else {
         return false;
     }
     var setting = { name: aPrefName,
                     type: prefType,
                     value: prefVal };
-    if (aWhere != "ref-") {
-        aTestPrefSettings.push(setting);
-    }
-    if (aWhere != "test-") {
-        aRefPrefSettings.push(setting);
+    if (gCompareStyloToGecko && aPrefName != "layout.css.servo.enabled") {
+        // ref-pref() is ignored, test-pref() and pref() are added to both
+        if (aWhere != "ref-") {
+            aTestPrefSettings.push(setting);
+            aRefPrefSettings.push(setting);
+        }
+    } else {
+        if (aWhere != "ref-") {
+            aTestPrefSettings.push(setting);
+        }
+        if (aWhere != "test-") {
+            aRefPrefSettings.push(setting);
+        }
     }
     return true;
 }
 
 function ReadTopManifest(aFileURL, aFilter)
 {
     var url = gIOService.newURI(aFileURL);
     if (!url)
@@ -1117,18 +1125,22 @@ function ReadManifest(aURL, inherited_st
                                      gIOService.newURI(items[2], null, listURL)];
             var prettyPath = runHttp
                            ? gIOService.newURI(items[1], null, listURL).spec
                            : testURI.spec;
             secMan.checkLoadURIWithPrincipal(principal, testURI,
                                              CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
             secMan.checkLoadURIWithPrincipal(principal, refURI,
                                              CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
-
-            AddTestItem({ type: items[0],
+            var type = items[0];
+            if (gCompareStyloToGecko) {
+                type = TYPE_REFTEST_EQUAL;
+                refURI = testURI;
+            }
+            AddTestItem({ type: type,
                           expected: expected_status,
                           allowSilentFail: allow_silent_fail,
                           prettyPath: prettyPath,
                           minAsserts: minAsserts,
                           maxAsserts: maxAsserts,
                           needsFocus: needs_focus,
                           slow: slow,
                           prefSettings1: testPrefSettings,