Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/index.html

Issue 10964120: Made Synchronizer tests work again (Closed)
Patch Set: Created July 12, 2013, 1:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/common.js ('k') | chrome/content/tests/synchronizer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « chrome/content/common.js ('k') | chrome/content/tests/synchronizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld