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

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

Issue 218273002: Upgrading tests with unittest deprecations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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) 2013, the Dart project authors. Please see the AUTHORS file 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 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 import 'dart:isolate'; 5 import 'dart:isolate';
6 import "package:unittest/unittest.dart"; 6 import "package:unittest/unittest.dart";
7 import "remote_unittest_helper.dart"; 7 import "remote_unittest_helper.dart";
8 8
9 void main([args, port]) { 9 void main([args, port]) {
10 if (testRemote(main, port)) return; 10 if (testRemote(main, port)) return;
11 test("stacktrace_message", () { 11 test("stacktrace_message", () {
12 ReceivePort reply = new ReceivePort(); 12 ReceivePort reply = new ReceivePort();
13 Isolate.spawn(runTest, reply.sendPort); 13 Isolate.spawn(runTest, reply.sendPort);
14 reply.first.then(expectAsync1((StackTrace stack) { 14 reply.first.then(expectAsync((StackTrace stack) {
15 print(stack); 15 print(stack);
16 })); 16 }));
17 }); 17 });
18 } 18 }
19 19
20 runTest(SendPort sendport) { 20 runTest(SendPort sendport) {
21 try { 21 try {
22 throw 'sorry'; 22 throw 'sorry';
23 } catch (e, stack) { 23 } catch (e, stack) {
24 try { 24 try {
25 sendport.send(stack); 25 sendport.send(stack);
26 print("Stacktrace sent"); 26 print("Stacktrace sent");
27 } catch (e) { 27 } catch (e) {
28 print("Stacktrace not sent"); 28 print("Stacktrace not sent");
29 sendport.send(null); 29 sendport.send(null);
30 } 30 }
31 } 31 }
32 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698