OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /// Tests that Isolate.spanUri completes with an error when the given URI |
| 6 /// doesn't resolve to an existing resource. |
| 7 library test.isolate.spawn_uri_missing_test; |
| 8 |
| 9 import 'dart:isolate'; |
| 10 |
| 11 import 'dart:async'; |
| 12 |
| 13 import 'package:async_helper/async_helper.dart'; |
| 14 |
| 15 Future doTest() { |
| 16 return Isolate.spawnUri(Uri.base.resolve('no_such_file'), [], null) |
| 17 .then((Isolate isolate) { |
| 18 throw 'Created isolate from missing file'; |
| 19 }).catchError((error) { |
| 20 print('An error was thrown as expected'); |
| 21 return null; |
| 22 }); |
| 23 } |
| 24 |
| 25 main() { |
| 26 asyncTest(doTest); |
| 27 } |
OLD | NEW |