Bug 1380082 - Check Stylo env var for reftest processing. r=xidorn draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 11 Jul 2017 13:35:57 -0500
changeset 607854 18bdb70240a5c096bdd52e9c4ddae79df0d9d91b
parent 607853 b57f87db56c5c44d88bf82fcb283341e2eb8fa41
child 607855 b1fb47c77fa178deafe0d4f077dd7b819271b420
push id68126
push userbmo:jryans@gmail.com
push dateWed, 12 Jul 2017 23:00:32 +0000
reviewersxidorn
bugs1380082
milestone56.0a1
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
layout/tools/reftest/reftest.jsm
--- 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;