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

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

Issue 12919011: Remove streamSpawnUri and mangler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 9 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
(Empty)
1 // Copyright (c) 2013, 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 import 'dart:async';
6 import 'dart:isolate';
7
8 runTest() {
9 IsolateSink mainIsolate;
10 stream.listen((msg) {
11 mainIsolate = msg;
12 throw new RuntimeError("ignore exception");
13 }, onDone: () {
14 mainIsolate.add("received done");
15 mainIsolate.close();
16 });
17 }
18
19 bool globalErrorHandler(IsolateUnhandledException e) {
20 var source = e.source;
21 if (source is AsyncError) {
22 source = source.error;
23 }
24 return source is RuntimeError && source.message == "ignore exception";
25 }
26
27 main() {
28 // Make sure this test doesn't last longer than 2 seconds.
29 var timer = new Timer(const Duration(seconds: 2), () { throw "failed"; });
30
31 var box = new MessageBox();
32 IsolateSink otherIsolate = streamSpawnFunction(runTest, globalErrorHandler);
33 otherIsolate.add(box.sink);
34 otherIsolate.close();
35 box.stream.single.then((msg) {
36 Expect.equals("received done", msg);
37 timer.cancel();
38 });
39 }
OLDNEW
« no previous file with comments | « tests/isolate/global_error_handler2_test.dart ('k') | tests/isolate/global_error_handler_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698