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

Side by Side Diff: dart/tests/isolate/spawn_uri_missing_from_isolate_test.dart

Issue 306523002: Tweak isolate/spawn_uri_missing*test.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Tests that Isolate.spawnUri completes with an error when the given URI 5 /// Tests that Isolate.spawnUri completes with an error when the given URI
6 /// doesn't resolve to an existing resource. 6 /// doesn't resolve to an existing resource.
7 /// 7 ///
8 /// This test is similar to spawn_uri_missing_test.dart, but tests what happens 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, 9 /// when Isolate.spawnUri is called from an a spawned isolate. In dart2js,
10 /// these two situations are different. 10 /// these two situations are different.
(...skipping 12 matching lines...) Expand all
23 void isolate(SendPort port) { 23 void isolate(SendPort port) {
24 doTest().then( 24 doTest().then(
25 (_) => port.send(SUCCESS), 25 (_) => port.send(SUCCESS),
26 onError: (error, stack) => port.send('Test failed: $error\n$stack')); 26 onError: (error, stack) => port.send('Test failed: $error\n$stack'));
27 } 27 }
28 28
29 main() { 29 main() {
30 ReceivePort port = new ReceivePort(); 30 ReceivePort port = new ReceivePort();
31 Isolate.spawn(isolate, port.sendPort); 31 Isolate.spawn(isolate, port.sendPort);
32 Completer completer = new Completer(); 32 Completer completer = new Completer();
33 port.listen((message) { 33 port.first.then((message) {
34 if (message == SUCCESS) { 34 if (message == SUCCESS) {
35 completer.complete(null); 35 completer.complete(null);
36 } else { 36 } else {
37 completer.completeError(message); 37 completer.completeError(message);
38 } 38 }
39 port.close();
40 }); 39 });
41 40
42 asyncTest(() => completer.future); 41 asyncTest(() => completer.future);
43 } 42 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/isolate/spawn_uri_missing_test.dart » ('j') | dart/tests/isolate/spawn_uri_missing_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698