Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: tests/html/dromaeo_smoke_test.dart

Issue 12086028: Fix up dromaeo after lib v2 merge and add Dromaeo smoketest to prevent future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/dromaeo_smoke-html.html ('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
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library dromaeo;
6 import '../../pkg/unittest/lib/unittest.dart';
7 import '../../pkg/unittest/lib/html_config.dart';
8 import '../../samples/third_party/dromaeo/Dromaeo.dart' as originalTest;
9 import 'dart:html';
10 import 'dart:async';
11
12 /** A variant of the Dromaeo test shoehorned into a unit test. */
13 void main() {
14 var combo = '?dartANDhtmlANDnothing';
15 if (!window.location.search.toString().contains(combo)) {
16 if (window.location.href.toString().indexOf("?") == -1) {
17 window.location.href = '${window.location.href}${combo}';
18 } else {
19 window.location.href = '${window.location.href.toString().substring(0,
20 window.location.href.toString().indexOf("?"))}${combo}';
21 }
22 }
23
24 useHtmlConfiguration();
25
26 var scriptSrc = new ScriptElement();
27 scriptSrc.src = '../../../../pkg/browser/lib/dart.js';
28 document.head.children.add(scriptSrc);
29 document.body.innerHtml = '''${document.body.innerHtml}
30 <div id="main">
31 <h1 id="overview" class="test"><span>Performance Tests</span>
32 <input type="button" id="pause" class="pause" value="Loading..."/>
33 <div class="bar">
34 <div id="timebar" style="width:25%;">
35 <span class="left">Est.&nbsp;Time:&nbsp;<strong id="left">0:00</strong>
36 </span>
37 </div>
38 </div>
39 <ul id="tests">
40 <li><a href="?dom">Smoke Tests</a></li>
41 </ul>
42 </div>''';
43
44 bool isDone = false;
45 originalTest.main();
46
47 test('dromaeo runs', () {
48 new Timer.repeating(500, expectAsyncUntil1((timer) {
49 if (document.query('.alldone') != null) {
50 timer.cancel();
51 isDone = true;
52 }
53 }, () => isDone));
54 });
55 }
OLDNEW
« no previous file with comments | « tests/html/dromaeo_smoke-html.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698