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

Unified Diff: dart/tests/try/end_to_end_test.dart

Issue 216113004: Try Dart! end-to-end test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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
« no previous file with comments | « dart/site/try/src/compilation.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/try/end_to_end_test.dart
diff --git a/dart/tests/try/end_to_end_test.dart b/dart/tests/try/end_to_end_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3f85b43865e989d71dc9790d151603af49879730
--- /dev/null
+++ b/dart/tests/try/end_to_end_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/// Whitebox integration/end-to-end test of Try Dart! site.
+///
+/// This test opens Try Dart! in an iframe. When opened the first time, Try
+/// Dart! will display a simple hello-world example, color tokens, compile the
+/// example, and run the result. We've instrumented Try Dart! to use
+/// window.parent.postMessage when the running program prints anything. So this
+/// test just waits for a "Hello, World!" message.
+library trydart.end_to_end_test;
+
+import 'dart:html';
+import 'dart:async';
+
+import 'package:async_helper/async_helper.dart';
+
+void main() {
+ asyncStart();
+ window.onMessage.listen((MessageEvent e) {
+ if (e.data == 'Hello, World!\n') {
+ // Clear the DOM to work around a bug in test.dart.
+ document.body.nodes.clear();
+
+ // Clean up after ourselves.
+ window.localStorage.clear();
+
+ asyncSuccess(null);
+ } else {
+ window.console.dir(e.data);
+ }
+ });
+
+ // Clearing localStorage makes Try Dart! think it is opening for the first
+ // time.
+ window.localStorage.clear();
+
+ document.body.append(new IFrameElement()
+ ..src = '/root_build/try_dartlang_org/index.html'
+ ..style.width = '90vw'
+ ..style.height = '90vh');
+}
« no previous file with comments | « dart/site/try/src/compilation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698