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

Unified Diff: dart/tests/try/web/incremental_compilation_update_test.dart

Issue 645513002: Scaffolding for testing incremental compilation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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: dart/tests/try/web/incremental_compilation_update_test.dart
diff --git a/dart/tests/try/web/incremental_compilation_update_test.dart b/dart/tests/try/web/incremental_compilation_update_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b0db6bcac3a89949ac663b796956e19ddb358e70
--- /dev/null
+++ b/dart/tests/try/web/incremental_compilation_update_test.dart
@@ -0,0 +1,49 @@
+// 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.
+
+library trydart.incremental_compilation_update_test;
+
+import 'dart:html';
+
+import 'dart:async' show
+ Future;
+
+import 'package:async_helper/async_helper.dart' show
+ asyncTest;
+
+import 'sandbox.dart' show
+ appendIFrame,
+ listener;
+
+import 'web_compiler_test_case.dart' show
+ WebCompilerTestCase;
+
+void main() => asyncTest(() {
+ listener.start();
+
+ IFrameElement iframe =
+ appendIFrame(
+ '/root_dart/tests/try/web/incremental_compilation_update.html',
+ document.body)
+ ..style.width = '90vw'
+ ..style.height = '90vh';
Johnni Winther 2014/10/10 10:28:56 Out of curiosity: What does the 'vw' and 'vh' suff
ahe 2014/10/10 11:05:04 Viewport width and viewport height.
+
+ return listener.expect('iframe-ready').then((_) {
+ Future<String> future =
+ new WebCompilerTestCase("main() { print('Hello, World!'); }").run();
+ return future.then((String jsCode) {
+ var objectUrl =
+ Url.createObjectUrl(new Blob([jsCode], 'application/javascript'));
+
+ iframe.contentWindow.postMessage(['add-script', objectUrl], '*');
+ return listener.expect(['Hello, World!', 'iframe-dart-main-done']).then(
+ (_) {
+ // TODO(ahe): Add incremental compilation here.
+ });
+ });
+ }).then((_) {
+ // Remove the iframe to work around a bug in test.dart.
+ iframe.remove();
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698