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

Side by Side 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, 8 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 | « dart/site/try/src/compilation.dart ('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) 2014, 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 /// Whitebox integration/end-to-end test of Try Dart! site.
6 ///
7 /// This test opens Try Dart! in an iframe. When opened the first time, Try
8 /// Dart! will display a simple hello-world example, color tokens, compile the
9 /// example, and run the result. We've instrumented Try Dart! to use
10 /// window.parent.postMessage when the running program prints anything. So this
11 /// test just waits for a "Hello, World!" message.
12 library trydart.end_to_end_test;
13
14 import 'dart:html';
15 import 'dart:async';
16
17 import 'package:async_helper/async_helper.dart';
18
19 void main() {
20 asyncStart();
21 window.onMessage.listen((MessageEvent e) {
22 if (e.data == 'Hello, World!\n') {
23 // Clear the DOM to work around a bug in test.dart.
24 document.body.nodes.clear();
25
26 // Clean up after ourselves.
27 window.localStorage.clear();
28
29 asyncSuccess(null);
30 } else {
31 window.console.dir(e.data);
32 }
33 });
34
35 // Clearing localStorage makes Try Dart! think it is opening for the first
36 // time.
37 window.localStorage.clear();
38
39 document.body.append(new IFrameElement()
40 ..src = '/root_build/try_dartlang_org/index.html'
41 ..style.width = '90vw'
42 ..style.height = '90vh');
43 }
OLDNEW
« 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