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); |
+} |