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

Unified Diff: dart/tests/isolate/spawn_uri_missing_test.dart

Issue 292743019: Complete with error if Worker fails. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r36656 Created 6 years, 7 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/isolate/spawn_uri_missing_from_isolate_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/isolate/spawn_uri_missing_test.dart
diff --git a/dart/tests/isolate/spawn_uri_missing_test.dart b/dart/tests/isolate/spawn_uri_missing_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c3dd4d32f4aa2ea316491c2f64aaca24a4d069d3
--- /dev/null
+++ b/dart/tests/isolate/spawn_uri_missing_test.dart
@@ -0,0 +1,27 @@
+// 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.
+
+/// Tests that Isolate.spanUri completes with an error when the given URI
+/// doesn't resolve to an existing resource.
+library test.isolate.spawn_uri_missing_test;
+
+import 'dart:isolate';
+
+import 'dart:async';
+
+import 'package:async_helper/async_helper.dart';
+
+Future doTest() {
+ return Isolate.spawnUri(Uri.base.resolve('no_such_file'), [], null)
+ .then((Isolate isolate) {
+ throw 'Created isolate from missing file';
+ }).catchError((error) {
+ print('An error was thrown as expected');
+ return null;
+ });
+}
+
+main() {
+ asyncTest(doTest);
+}
« no previous file with comments | « dart/tests/isolate/spawn_uri_missing_from_isolate_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698