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

Unified Diff: dart/tests/try/web/incremental_compilation_update.html

Issue 645513002: Scaffolding for testing incremental compilation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix bad refactoring. 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.html
diff --git a/dart/tests/try/web/incremental_compilation_update.html b/dart/tests/try/web/incremental_compilation_update.html
new file mode 100644
index 0000000000000000000000000000000000000000..d929ba9d14acdfd93233e1fe3ec9dbdf70349d24
--- /dev/null
+++ b/dart/tests/try/web/incremental_compilation_update.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!-- 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.
+ -->
+<html lang="en">
+ <head>
+ <title>incremental_compilation_update_test.html</title>
+ <meta charset="UTF-8">
+ </head>
+ <body>
+ <h1>incremental_compilation_update_test.html</h1>
+ <pre id="console"></pre>
+<script type="application/javascript" src="print.js"></script>
+<script type="application/javascript">
+/// Invoked by JavaScript code generated by dart2js when the program is ready
+/// to invoke main.
+function dartMainRunner(main) {
+ // Invoke the "main" method of the Dart program.
+ main();
+
+ // Let the sandbox embedder know that main is done running.
+ window.parent.postMessage('iframe-dart-main-done', '*');
+}
+(function() {
+
+ /// Invoked when a 'message' event is received. Message events are generated
+ /// with Window.postMessage and used to communicate between this iframe and
+ /// its embedding parent page.
+ function onMessage(e) {
+ if (e.data[0] === 'add-script') {
+ // Received a message on the form ['add-script', uri].
+ // Install a new script tag with the uri.
+ var script = document.createElement('script');
+ script.src = e.data[1];
+ script.type = 'application/javascript';
+ document.body.appendChild(script);
+ } else {
+ // Other messages are just logged.
+ console.log(e);
+ }
+ }
+ window.addEventListener('message', onMessage, false);
+
+ // Let the sandbox embedder know that this iframe is ready, that is,
+ // listening for messages.
+ window.parent.postMessage('iframe-ready', '*');
+
+})();
+</script>
+ </body>
+</html>
« no previous file with comments | « dart/tests/try/web/end_to_end_test.dart ('k') | dart/tests/try/web/incremental_compilation_update_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698