Bug 618977 - Specifying an invalid test-path no longer complains about no tests to run, instead just does nothing. r=gavin, a=test-only
authorJoel Maher <jmaher@mozilla.com>
Fri, 20 May 2011 11:54:01 -0400
changeset 69771 a365ca6c2379320357bf8ffa54006a916d02ed7d
parent 69770 f3b87db5dc4eed8c57d34e5b523c673f2644c607
child 69772 40195c0187d3069b848b012065476ab8868e6d0c
push idunknown
push userunknown
push dateunknown
reviewersgavin, test-only
bugs618977
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 618977 - Specifying an invalid test-path no longer complains about no tests to run, instead just does nothing. r=gavin, a=test-only
testing/mochitest/browser-harness.xul
testing/mochitest/chrome-harness.js
--- a/testing/mochitest/browser-harness.xul
+++ b/testing/mochitest/browser-harness.xul
@@ -196,16 +196,18 @@
         }
         return html;
       }
     };
 
     // Returns an array of browserTest objects for all the selected tests
     function listTests() {
       [links, singleTestPath] = getTestList();
+      if (!links)
+        return [];
 
       // load server.js in so we can share template functions
       var scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
                            getService(Ci.mozIJSSubScriptLoader);
       var srvScope = {};
       scriptLoader.loadSubScript('chrome://mochikit/content/server.js',
                                  srvScope);
 
--- a/testing/mochitest/chrome-harness.js
+++ b/testing/mochitest/chrome-harness.js
@@ -128,16 +128,19 @@ function getMochitestJarListing(aBasePat
         var singleObject = {};
         singleObject[singleTestPath] = true;
         return [singleObject, singleTestPath];
       }
     }
     else if (zReader.hasEntry(pathToCheck + "/")) {
       base = pathToCheck + "/";
     }
+    else {
+      return [];
+    }
   }
   var [links, count] = zList(base, zReader, basePath, true);
   return [links, null];
 }
 
 /*
  * Replicate the server.js list() function with a .jar file
  *