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

Side by Side Diff: test/index.html

Issue 4895499043733504: Issue 510 - [Typed objects] Don`t hardcode script load order in unit tests (Closed)
Patch Set: Created Jan. 10, 2015, 12:13 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« test/common.js ('K') | « test/common.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <link rel="stylesheet" href="qunit.css"/> 4 <link rel="stylesheet" href="qunit.css"/>
5 5
6 <script>
7 var js17supported = false;
8 </script>
9 <script type="text/javascript;version=1.7">
10 js17supported = true;
11 </script>
12
13 <script src="jquery-1.7.1.min.js"></script> 6 <script src="jquery-1.7.1.min.js"></script>
14 <script src="qunit.js"></script> 7 <script src="qunit.js"></script>
15 <script src="common.js"></script> 8 <script src="common.js"></script>
16 9
17 <script> 10 <script>
18 var libs = [ 11 var evalScript = function(source)
19 "typedObjects/utils.js", 12 {
20 "typedObjects/hash.js", 13 return eval(source);
21 "typedObjects/arrayTypes.js", 14 };
22 "typedObjects/dictionaryTypes.js", 15 var evalModule = function(source)
23 "typedObjects/primitiveTypes.js", 16 {
24 "typedObjects/references.js", 17 var result = {};
25 "typedObjects/objectTypes.js", 18 new Function("exports", source)(result);
26 "typedObjects/stringType.js", 19 return result;
27 "typedObjects.js" 20 };
28 ]; 21 var js17supported = false;
29 for (var i = 0; i < libs.length; i++) 22 </script>
30 addScript("/lib/" + libs[i]);
31 23
32 var tests = [ 24 <script type="text/javascript;version=1.7">
33 "typedObjects.js" 25 evalScript = function(source)
Felix Dahlke 2015/02/03 06:30:24 Missed this before: Why are evalScript and evalMo
Felix Dahlke 2015/02/03 06:39:45 Oh nevermind that, to run it as JS 1.7 code of cou
34 ]; 26 {
35 for (var i = 0; i < tests.length; i++) 27 return eval(source);
Sebastian Noack 2015/02/03 09:21:10 Do you ever plan to run those tests as part of a C
Wladimir Palant 2015/02/03 16:26:04 The tests themselves - yes, sure. However, the fra
36 addScript("/tests/" + tests[i]); 28 };
29 evalModule = function(source)
30 {
31 var result = {};
32 new Function("exports", source)(result);
33 return result;
34 };
35 js17supported = true;
36 </script>
37
38 <script>
39 addScript("/lib.js");
40 addScript("/tests.js");
41
42 window.addEventListener("load", function()
43 {
44 for (var i = 0; i < tests.length; i++)
45 evalScript(tests[i]);
46 }, false);
37 </script> 47 </script>
38 </head> 48 </head>
39 <body> 49 <body>
40 <h1 id="qunit-header">Adblock Plus unit tests</h1> 50 <h1 id="qunit-header">Adblock Plus unit tests</h1>
41 <h2 id="qunit-banner"></h2> 51 <h2 id="qunit-banner"></h2>
42 <div id="qunit-testrunner-toolbar"></div> 52 <div id="qunit-testrunner-toolbar"></div>
43 <h2 id="qunit-userAgent"></h2> 53 <h2 id="qunit-userAgent"></h2>
44 <ol id="qunit-tests"></ol> 54 <ol id="qunit-tests"></ol>
45 </body> 55 </body>
46 </html> 56 </html>
OLDNEW
« test/common.js ('K') | « test/common.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld