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

--HG--
extra : rebase_source : 70262f7d6863cdee769700d449f8e2183af7225d
This commit is contained in:
Boris Zbarsky 2017-02-22 19:30:57 -05:00
parent 0c4924ad08
commit 39855cf6b2
2 changed files with 18 additions and 12 deletions

View File

@ -71,8 +71,8 @@ asserts(1-2) == vertical-table-specified-width-2.html vertical-table-specified-w
fails == wm-row-progression-002.xht wm-row-progression-002.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-003.xht wm-row-progression-003.xht
fails == wm-row-progression-004.xht wm-row-progression-004.xht fails == wm-row-progression-004.xht wm-row-progression-004.xht
== wm-row-progression-004.xht wm-row-progression-005.xht fails == wm-row-progression-005.xht wm-row-progression-005.xht
== wm-row-progression-004.xht wm-row-progression-006.xht fails == wm-row-progression-006.xht wm-row-progression-006.xht
fails == wm-row-progression-007.xht wm-row-progression-007.xht fails == wm-row-progression-007.xht wm-row-progression-007.xht
# == table-caption-top-1.html table-caption-top-1.html # == table-caption-top-1.html table-caption-top-1.html

View File

@ -845,6 +845,14 @@ function AddTestItem(aTest, aFilter)
gURLs.push(aTest); 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, // Note: If you materially change the reftest manifest parsing,
// please keep the parser in print-manifest-dirs.py in sync. // please keep the parser in print-manifest-dirs.py in sync.
function ReadManifest(aURL, inherited_status, aFilter) function ReadManifest(aURL, inherited_status, aFilter)
@ -879,6 +887,10 @@ function ReadManifest(aURL, inherited_status, aFilter)
var lineNo = 0; var lineNo = 0;
var urlprefix = ""; var urlprefix = "";
var defaultTestPrefSettings = [], defaultRefPrefSettings = []; var defaultTestPrefSettings = [], defaultRefPrefSettings = [];
if (gCompareStyloToGecko) {
AddStyloTestPrefs(sandbox, defaultTestPrefSettings,
defaultRefPrefSettings);
}
for (var str of lines) { for (var str of lines) {
++lineNo; ++lineNo;
if (str.charAt(0) == "#") if (str.charAt(0) == "#")
@ -913,6 +925,10 @@ function ReadManifest(aURL, inherited_status, aFilter)
throw "Error in pref value in manifest file " + aURL.spec + " line " + lineNo; throw "Error in pref value in manifest file " + aURL.spec + " line " + lineNo;
} }
} }
if (gCompareStyloToGecko) {
AddStyloTestPrefs(sandbox, defaultTestPrefSettings,
defaultRefPrefSettings);
}
continue; continue;
} }
@ -1321,16 +1337,6 @@ function StartCurrentURI(aState)
var prefs = Components.classes["@mozilla.org/preferences-service;1"]. var prefs = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch); 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]; var prefSettings = gURLs[0]["prefSettings" + aState];
if (prefSettings.length > 0) { if (prefSettings.length > 0) {
var badPref = undefined; var badPref = undefined;