Index: chrome/content/index.html |
=================================================================== |
--- a/chrome/content/index.html |
+++ b/chrome/content/index.html |
@@ -13,31 +13,36 @@ |
{ |
let module = {}; |
module.wrappedJSObject = module; |
Services.obs.notifyObservers(module, "adblockplustests-require", "info"); |
let {addonRoot} = module.exports; |
let uri = Services.io.newURI(addonRoot, null, null).QueryInterface(Components.interfaces.nsIJARURI); |
- let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader); |
- zipReader.open(uri.JARFile.QueryInterface(Ci.nsIFileURL).file); |
+ let result = []; |
+ if ("test" in QUnit.urlParams) |
+ result.push("tests/" + QUnit.urlParams.test + ".js"); |
+ else |
+ { |
+ let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader); |
+ zipReader.open(uri.JARFile.QueryInterface(Ci.nsIFileURL).file); |
- let result = []; |
- let enumerator = zipReader.findEntries(null); |
- let prefix = "chrome/content/tests/"; |
- while (enumerator.hasMore()) |
- { |
- let name = enumerator.getNext(); |
- if (name.indexOf(prefix) == 0 && /\.js$/.test(name)) |
- result.push("tests/" + name.replace(prefix, "")); |
+ let enumerator = zipReader.findEntries(null); |
+ let prefix = "chrome/content/tests/"; |
+ while (enumerator.hasMore()) |
+ { |
+ let name = enumerator.getNext(); |
+ if (name.indexOf(prefix) == 0 && /\.js$/.test(name)) |
+ result.push("tests/" + name.replace(prefix, "")); |
+ } |
+ |
+ zipReader.close(); |
} |
- zipReader.close(); |
- |
result.sort(); |
return result; |
} |
let files = getTestFiles(); |
for each (let file in files) |
{ |
let script = document.createElement("script"); |