Bug 1123945 - Fix --no-autorun harness option. r=jmaher
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 21 Jan 2015 13:04:13 -0600
changeset 362154 9bda75f63db7798be454ba6e2242a9bf4b1a933a
parent 362153 ee5109a2d1b469a70212c8e76215f4a8cfd7ad21
child 362155 d796ff6e72ffb06488ea08376ea28a436f3d7fb0
push id50116
push userjryans@gmail.com
push dateWed, 21 Jan 2015 19:04:22 +0000
treeherdertry@d796ff6e72ff [default view] [failures only]
reviewersjmaher
bugs1123945
milestone38.0a1
Bug 1123945 - Fix --no-autorun harness option. r=jmaher
testing/mochitest/tests/SimpleTest/setup.js
--- a/testing/mochitest/tests/SimpleTest/setup.js
+++ b/testing/mochitest/tests/SimpleTest/setup.js
@@ -53,20 +53,22 @@ function parseQueryString(encodedString,
 var params = parseQueryString(location.search.substring(1), true);
 
 var config = {};
 if (window.readConfig) {
   config = readConfig();
 }
 
 if (config.testRoot == "chrome" || config.testRoot == "a11y") {
-  for (p in params) {
-    if (params[p] == 1) {
+  for (var p in params) {
+    // Compare with arrays to find boolean equivalents, since that's what
+    // |parseQueryString| with useArrays returns.
+    if (params[p] == [1]) {
       config[p] = true;
-    } else if (params[p] == 0) {
+    } else if (params[p] == [0]) {
       config[p] = false;
     } else {
       config[p] = params[p];
     }
   }
   params = config;
   params.baseurl = "chrome://mochitests/content";
 } else {