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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: tests/html/dromaeo_smoke_test.dart
diff --git a/tests/html/dromaeo_smoke_test.dart b/tests/html/dromaeo_smoke_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..813d0884382a8f41777a7d39b8cfddf25d863f38
--- /dev/null
+++ b/tests/html/dromaeo_smoke_test.dart
@@ -0,0 +1,53 @@
+library dromaeo;
+import '../../pkg/unittest/lib/unittest.dart';
+import '../../pkg/unittest/lib/html_config.dart';
+import '../../samples/third_party/dromaeo/Dromaeo.dart' as originalTest;
+import 'dart:html';
+import 'dart:async';
+
+/** A variant of the Dromaeo test shoehorned into a unit test. */
+void main() {
+ var combo = '?dartANDhtmlANDnothing';
+ if (!window.location.search.toString().contains(combo)) {
+ if (window.location.href.toString().indexOf("?") == -1) {
+ window.location.href = '${window.location.href}${combo}';
+ } else {
+ window.location.href = '${window.location.href.toString().substring(0,
+ window.location.href.toString().indexOf("?"))}${combo}';
+ }
+ }
+
+ useHtmlConfiguration();
+
+ var scriptSrc = new ScriptElement();
+ scriptSrc.src = 'http://dart.googlecode.com/svn/branches/bleeding_edge/dart/'
+ '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.
+ document.head.children.add(scriptSrc);
+ document.body.innerHtml = '''${document.body.innerHtml}
+ <div id="main">
+ <h1 id="overview" class="test"><span>Performance Tests</span>
+ <input type="button" id="pause" class="pause" value="Loading..."/>
+ <div class="bar">
+ <div id="timebar" style="width:25%;">
+ <span class="left">Est.&nbsp;Time:&nbsp;<strong id="left">0:00</strong>
+ </span>
+ </div>
+ </div>
+ <ul id="tests">
+ <li><a href="?dom">Smoke Tests</a></li>
+ </ul>
+ </div>''';
+
+ bool isDone = false;
+ originalTest.main();
+
+ test('dromaeo runs', () {
+ new Timer.repeating(500, expectAsyncUntil1((timer) {
+ if (document.query('.alldone') != null) {
+ timer.cancel();
+ isDone = true;
+ expect(true, true);
vsm 2013/01/30 22:35:51 Why? :-)
Emily Fortuna 2013/01/31 00:44:58 Removed!
+ }
+ }, () => isDone));
+ });
+}
« tests/html/dromaeo_noop/dromaeo_smoke.dart.js ('K') | « tests/html/dromaeo_smoke-html.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698