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

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

Issue 641143002: Perform incremental compilation, and run the updated program. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r41074. 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
« no previous file with comments | « dart/tests/try/web/incremental_compilation_update.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index b0db6bcac3a89949ac663b796956e19ddb358e70..4c043edf50932007aaaaaf678e527121b178325d 100644
--- a/dart/tests/try/web/incremental_compilation_update_test.dart
+++ b/dart/tests/try/web/incremental_compilation_update_test.dart
@@ -17,7 +17,8 @@ import 'sandbox.dart' show
listener;
import 'web_compiler_test_case.dart' show
- WebCompilerTestCase;
+ WebCompilerTestCase,
+ WebInputProvider;
void main() => asyncTest(() {
listener.start();
@@ -30,16 +31,29 @@ void main() => asyncTest(() {
..style.height = '90vh';
return listener.expect('iframe-ready').then((_) {
- Future<String> future =
- new WebCompilerTestCase("main() { print('Hello, World!'); }").run();
- return future.then((String jsCode) {
+ WebCompilerTestCase test =
+ new WebCompilerTestCase("main() { print('Hello, World!'); }");
+ return test.run().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.
+ WebInputProvider inputProvider =
+ test.incrementalCompiler.inputProvider;
+ Uri uri = test.scriptUri.resolve('?v2');
+ inputProvider.cachedSources[uri] = new Future.value(
+ "main() { print('Hello, Brave New World!'); }");
+ Future future = test.incrementalCompiler.compileUpdates(
+ {test.scriptUri: uri});
+ return future.then((String update) {
+ iframe.contentWindow.postMessage(['apply-update', update], '*');
+
+ return listener.expect(
+ ['Hello, Brave New World!',
+ 'iframe-dart-updated-main-done']);
+ });
});
});
}).then((_) {
« no previous file with comments | « dart/tests/try/web/incremental_compilation_update.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698