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

Side by Side Diff: dart/tests/isolate/spawn_uri_missing_from_isolate_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, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/tests/isolate/isolate.status ('k') | dart/tests/isolate/spawn_uri_missing_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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.spawnUri completes with an error when the given URI
6 /// doesn't resolve to an existing resource.
7 ///
8 /// This test is similar to spawn_uri_missing_test.dart, but tests what happens
9 /// when Isolate.spawnUri is called from an a spawned isolate. In dart2js,
10 /// these two situations are different.
11 library test.isolate.spawn_uri_missing_from_isolate_test;
12
13 import 'dart:isolate';
14
15 import 'dart:async';
16
17 import 'package:async_helper/async_helper.dart';
18
19 import 'spawn_uri_missing_test.dart';
20
21 const String SUCCESS = 'Test worked.';
22
23 void isolate(SendPort port) {
24 doTest().then(
25 (_) => port.send(SUCCESS),
26 onError: (error, stack) => port.send('Test failed: $error\n$stack'));
27 }
28
29 main() {
30 ReceivePort port = new ReceivePort();
31 Isolate.spawn(isolate, port.sendPort);
32 Completer completer = new Completer();
33 port.listen((message) {
34 if (message == SUCCESS) {
35 completer.complete(null);
36 } else {
37 completer.completeError(message);
38 }
39 });
40
41 asyncTest(() => completer.future);
42 }
OLDNEW
« no previous file with comments | « dart/tests/isolate/isolate.status ('k') | dart/tests/isolate/spawn_uri_missing_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698