bug 498685 - Add isDebugBuild to reftest sandbox, r=dbaron.
authorBob Clary <bclary@bclary.com>
Thu, 20 Aug 2009 00:55:59 -0700
changeset 31906 9d5b7c57cf4295981167db5045853a66eb227c9a
parent 31905 3d98dade7db3ca2c8f9611e9e691a9875272efbc
child 31907 d18db5828c6e925a27b4c6bac20db0c45deabf74
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs498685
milestone1.9.3a1pre
bug 498685 - Add isDebugBuild to reftest sandbox, r=dbaron.
layout/tools/reftest/reftest.js
--- a/layout/tools/reftest/reftest.js
+++ b/layout/tools/reftest/reftest.js
@@ -252,16 +252,17 @@ function ReadManifest(aURL)
                   createInstance(CI.nsIFileInputStream);
     fis.init(listURL.file, -1, -1, false);
     var lis = fis.QueryInterface(CI.nsILineInputStream);
 
     // Build the sandbox for fails-if(), etc., condition evaluation.
     var sandbox = new Components.utils.Sandbox(aURL.spec);
     var xr = CC[NS_XREAPPINFO_CONTRACTID].getService(CI.nsIXULRuntime);
     sandbox.MOZ_WIDGET_TOOLKIT = xr.widgetToolkit;
+    sandbox.isDebugBuild = gDebug.isDebugBuild;
     sandbox.xulRuntime = {widgetToolkit: xr.widgettoolkit, OS: xr.OS};
 
     // xr.XPCOMABI throws exception for configurations without full ABI support (mobile builds on ARM)
     try {
       sandbox.XPCOMABI = xr.XPCOMABI;
     } catch(e) {}
 
     var hh = CC[NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX + "http"].
@@ -325,17 +326,17 @@ function ReadManifest(aURL)
                 cond = false;
                 if (Components.utils.evalInSandbox("(" + m[1] + ")", sandbox)) {
                     minAsserts = Number(m[2]);
                     maxAsserts =
                       (m[3] == undefined) ? minAsserts
                                           : Number(m[3].substring(1));
                 }
             } else {
-                throw "Error in manifest file " + aURL.spec + " line " + lineNo;
+                throw "Error 1 in manifest file " + aURL.spec + " line " + lineNo;
             }
 
             if (cond) {
                 if (stat == "fails") {
                     expected_status = EXPECTED_FAIL;
                 } else if (stat == "random") {
                     expected_status = EXPECTED_RANDOM;
                 } else if (stat == "skip") {
@@ -358,28 +359,28 @@ function ReadManifest(aURL)
             // Accept HTTP(..), HTTP(../..), HTTP(../../..), etc.
             runHttp = true;
             httpDepth = (items[0].length - 5) / 3;
             items.shift();
         }
 
         if (items[0] == "include") {
             if (items.length != 2 || runHttp)
-                throw "Error in manifest file " + aURL.spec + " line " + lineNo;
+                throw "Error 2 in manifest file " + aURL.spec + " line " + lineNo;
             var incURI = gIOService.newURI(items[1], null, listURL);
             secMan.checkLoadURI(aURL, incURI,
                                 CI.nsIScriptSecurityManager.DISALLOW_SCRIPT);
             ReadManifest(incURI);
         } else if (items[0] == "load") {
             if (expected_status == EXPECTED_PASS)
                 expected_status = EXPECTED_LOAD;
             if (items.length != 2 ||
                 (expected_status != EXPECTED_LOAD &&
                  expected_status != EXPECTED_DEATH))
-                throw "Error in manifest file " + aURL.spec + " line " + lineNo;
+                throw "Error 3 in manifest file " + aURL.spec + " line " + lineNo;
             var [testURI] = runHttp
                             ? ServeFiles(aURL, httpDepth,
                                          listURL.file.parent, [items[1]])
                             : [gIOService.newURI(items[1], null, listURL)];
             var prettyPath = runHttp
                            ? gIOService.newURI(items[1], null, listURL).spec
                            : testURI.spec;
             secMan.checkLoadURI(aURL, testURI,
@@ -388,17 +389,17 @@ function ReadManifest(aURL)
                           expected: expected_status,
                           prettyPath: prettyPath,
                           minAsserts: minAsserts,
                           maxAsserts: maxAsserts,
                           url1: testURI,
                           url2: null } );
         } else if (items[0] == "==" || items[0] == "!=") {
             if (items.length != 3)
-                throw "Error in manifest file " + aURL.spec + " line " + lineNo;
+                throw "Error 4 in manifest file " + aURL.spec + " line " + lineNo;
             var [testURI, refURI] = runHttp
                                   ? ServeFiles(aURL, httpDepth,
                                                listURL.file.parent, [items[1], items[2]])
                                   : [gIOService.newURI(items[1], null, listURL),
                                      gIOService.newURI(items[2], null, listURL)];
             var prettyPath = runHttp
                            ? gIOService.newURI(items[1], null, listURL).spec
                            : testURI.spec;
@@ -409,17 +410,17 @@ function ReadManifest(aURL)
             gURLs.push( { equal: (items[0] == "=="),
                           expected: expected_status,
                           prettyPath: prettyPath,
                           minAsserts: minAsserts,
                           maxAsserts: maxAsserts,
                           url1: testURI,
                           url2: refURI } );
         } else {
-            throw "Error in manifest file " + aURL.spec + " line " + lineNo;
+            throw "Error 5 in manifest file " + aURL.spec + " line " + lineNo;
         }
     } while (more);
 }
 
 function AddURIUseCount(uri)
 {
     if (uri == null)
         return;