OLD | NEW |
---|---|
(Empty) | |
1 library dromaeo; | |
2 import '../../pkg/unittest/lib/unittest.dart'; | |
3 import '../../pkg/unittest/lib/html_config.dart'; | |
4 import '../../samples/third_party/dromaeo/Dromaeo.dart' as originalTest; | |
5 import 'dart:html'; | |
6 import 'dart:async'; | |
7 | |
8 /** A variant of the Dromaeo test shoehorned into a unit test. */ | |
9 void main() { | |
10 var combo = '?dartANDhtmlANDnothing'; | |
11 if (!window.location.search.toString().contains(combo)) { | |
12 if (window.location.href.toString().indexOf("?") == -1) { | |
13 window.location.href = '${window.location.href}${combo}'; | |
14 } else { | |
15 window.location.href = '${window.location.href.toString().substring(0, | |
16 window.location.href.toString().indexOf("?"))}${combo}'; | |
17 } | |
18 } | |
19 | |
20 useHtmlConfiguration(); | |
21 | |
22 var scriptSrc = new ScriptElement(); | |
23 scriptSrc.src = 'http://dart.googlecode.com/svn/branches/bleeding_edge/dart/' | |
24 'client/dart.js'; | |
vsm
2013/01/30 22:35:51
This file is going to be removed. You can use the
Emily Fortuna
2013/01/31 00:44:58
Done.
| |
25 document.head.children.add(scriptSrc); | |
26 document.body.innerHtml = '''${document.body.innerHtml} | |
27 <div id="main"> | |
28 <h1 id="overview" class="test"><span>Performance Tests</span> | |
29 <input type="button" id="pause" class="pause" value="Loading..."/> | |
30 <div class="bar"> | |
31 <div id="timebar" style="width:25%;"> | |
32 <span class="left">Est. Time: <strong id="left">0:00</strong> | |
33 </span> | |
34 </div> | |
35 </div> | |
36 <ul id="tests"> | |
37 <li><a href="?dom">Smoke Tests</a></li> | |
38 </ul> | |
39 </div>'''; | |
40 | |
41 bool isDone = false; | |
42 originalTest.main(); | |
43 | |
44 test('dromaeo runs', () { | |
45 new Timer.repeating(500, expectAsyncUntil1((timer) { | |
46 if (document.query('.alldone') != null) { | |
47 timer.cancel(); | |
48 isDone = true; | |
49 expect(true, true); | |
vsm
2013/01/30 22:35:51
Why? :-)
Emily Fortuna
2013/01/31 00:44:58
Removed!
| |
50 } | |
51 }, () => isDone)); | |
52 }); | |
53 } | |
OLD | NEW |