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

Unified Diff: pkg/dev_compiler/tool/run.js

Issue 2792703002: Fix ddc async test code (Closed)
Patch Set: Created 3 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 | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/run.js
diff --git a/pkg/dev_compiler/tool/run.js b/pkg/dev_compiler/tool/run.js
index a7de6ca85cbfd703943baf0489f90e3a4371d759..cca3aeb94bc9c0360113220e2a016c5bdd61126f 100644
--- a/pkg/dev_compiler/tool/run.js
+++ b/pkg/dev_compiler/tool/run.js
@@ -54,20 +54,21 @@ function finish(e) {
}
var async_helper = requirejs('async_helper').async_helper;
+sdk._isolate_helper.startRootIsolate(() => {}, []);
async_helper.asyncTestInitialize(finish);
var module = requirejs(test);
var lib = test.split('/').slice(-1)[0];
try {
- var result = sdk._isolate_helper.startRootIsolate(module[lib].main, []);
+ var result = module[lib].main();
// async_helper tests call finish directly - call here for all other
// tests.
if (!async_helper.asyncTestStarted) {
- if (!result || !(result instanceof dart_sdk.async.Future)) {
+ if (!result || !(sdk.async.Future.is(result))) {
finish();
} else {
// Wait iff result is a future
- result.then(dart_sdk.dart.dynamic)(() => finish());
+ result.then(sdk.dart.dynamic)(() => finish(), { onError: (e) => finish(e) });
}
}
} catch (e) {
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698