Bug 1380082 - Check Stylo env var for reftest processing. r=xidorn
Test harnesses may use STYLO_FORCE_ENABLED, so we need to check this value when
building the reftest conditions.
MozReview-Commit-ID: 998UMZHNKLl
--- a/layout/tools/reftest/reftest.jsm
+++ b/layout/tools/reftest/reftest.jsm
@@ -621,16 +621,18 @@ function getStreamContent(inputStream)
// Build the sandbox for fails-if(), etc., condition evaluation.
function BuildConditionSandbox(aURL) {
var sandbox = new Components.utils.Sandbox(aURL.spec);
var xr = CC[NS_XREAPPINFO_CONTRACTID].getService(CI.nsIXULRuntime);
var appInfo = CC[NS_XREAPPINFO_CONTRACTID].getService(CI.nsIXULAppInfo);
sandbox.isDebugBuild = gDebug.isDebugBuild;
var prefs = CC["@mozilla.org/preferences-service;1"].
getService(CI.nsIPrefBranch);
+ var env = CC["@mozilla.org/process/environment;1"].
+ getService(CI.nsIEnvironment);
// xr.XPCOMABI throws exception for configurations without full ABI
// support (mobile builds on ARM)
var XPCOMABI = "";
try {
XPCOMABI = xr.XPCOMABI;
} catch(e) {}
@@ -714,17 +716,19 @@ function BuildConditionSandbox(aURL) {
#if MOZ_WEBRTC
sandbox.webrtc = true;
#else
sandbox.webrtc = false;
#endif
#ifdef MOZ_STYLO
- sandbox.stylo = prefs.getBoolPref("layout.css.servo.enabled", false) && !gCompareStyloToGecko;
+ sandbox.stylo =
+ (!!env.get("STYLO_FORCE_ENABLED") || prefs.getBoolPref("layout.css.servo.enabled", false)) &&
+ !gCompareStyloToGecko;
sandbox.styloVsGecko = gCompareStyloToGecko;
#else
sandbox.stylo = false;
sandbox.styloVsGecko = false;
#endif
#ifdef RELEASE_OR_BETA
sandbox.release_or_beta = true;