Index: test/index.html |
=================================================================== |
--- a/test/index.html |
+++ b/test/index.html |
@@ -1,44 +1,54 @@ |
<!DOCTYPE html> |
<html> |
<head> |
<link rel="stylesheet" href="qunit.css"/> |
- <script> |
- var js17supported = false; |
- </script> |
- <script type="text/javascript;version=1.7"> |
- js17supported = true; |
- </script> |
- |
<script src="jquery-1.7.1.min.js"></script> |
<script src="qunit.js"></script> |
<script src="common.js"></script> |
<script> |
- var libs = [ |
- "typedObjects/utils.js", |
- "typedObjects/hash.js", |
- "typedObjects/arrayTypes.js", |
- "typedObjects/dictionaryTypes.js", |
- "typedObjects/primitiveTypes.js", |
- "typedObjects/references.js", |
- "typedObjects/objectTypes.js", |
- "typedObjects/stringType.js", |
- "typedObjects.js" |
- ]; |
- for (var i = 0; i < libs.length; i++) |
- addScript("/lib/" + libs[i]); |
+ var evalScript = function(source) |
+ { |
+ return eval(source); |
+ }; |
+ var evalModule = function(source) |
+ { |
+ var result = {}; |
+ new Function("exports", source)(result); |
+ return result; |
+ }; |
+ var js17supported = false; |
+ </script> |
- var tests = [ |
- "typedObjects.js" |
- ]; |
- for (var i = 0; i < tests.length; i++) |
- addScript("/tests/" + tests[i]); |
+ <script type="text/javascript;version=1.7"> |
+ evalScript = function(source) |
+ { |
+ return eval(source); |
+ }; |
+ evalModule = function(source) |
+ { |
+ var result = {}; |
+ new Function("exports", source)(result); |
+ return result; |
+ }; |
+ js17supported = true; |
+ </script> |
+ |
+ <script> |
+ addScript("/lib.js"); |
+ addScript("/tests.js"); |
+ |
+ window.addEventListener("load", function() |
+ { |
+ for (var i = 0; i < tests.length; i++) |
+ evalScript(tests[i]); |
+ }, false); |
</script> |
</head> |
<body> |
<h1 id="qunit-header">Adblock Plus unit tests</h1> |
<h2 id="qunit-banner"></h2> |
<div id="qunit-testrunner-toolbar"></div> |
<h2 id="qunit-userAgent"></h2> |
<ol id="qunit-tests"></ol> |