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

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

Issue 70103014: Make isolate tests work on drt (and hopefully dartium). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Retain isolate_stress_test in status file Created 7 years 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 | « tests/isolate/request_reply_test.dart ('k') | tests/isolate/spawn_function_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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Create a user-defined class in a new isolate. 5 // Create a user-defined class in a new isolate.
6 // 6 //
7 // Regression test for vm bug 2235: We were forgetting to finalize 7 // Regression test for vm bug 2235: We were forgetting to finalize
8 // classes in new isolates started using the v2 api. 8 // classes in new isolates started using the v2 api.
9 9
10 library spawn_tests; 10 library spawn_tests;
11 import 'dart:isolate'; 11 import 'dart:isolate';
12 import '../../pkg/unittest/lib/unittest.dart'; 12 import 'package:unittest/unittest.dart';
13 import "remote_unittest_helper.dart";
13 14
14 class MyClass { 15 class MyClass {
15 var myVar = 'there'; 16 var myVar = 'there';
16 myFunc(msg) { 17 myFunc(msg) {
17 return '$msg $myVar'; 18 return '$msg $myVar';
18 } 19 }
19 } 20 }
20 21
21 child(args) { 22 child(args) {
22 var reply = args[1]; 23 var reply = args[1];
23 var msg = args[0]; 24 var msg = args[0];
24 reply.send('re: ${new MyClass().myFunc(msg)}'); 25 reply.send('re: ${new MyClass().myFunc(msg)}');
25 } 26 }
26 27
27 main() { 28 void main([args, port]) {
29 if (testRemote(main, port)) return;
28 test('message - reply chain', () { 30 test('message - reply chain', () {
29 ReceivePort port = new ReceivePort(); 31 ReceivePort port = new ReceivePort();
30 Isolate.spawn(child, ['hi', port.sendPort]); 32 Isolate.spawn(child, ['hi', port.sendPort]);
31 port.listen((msg) { 33 port.listen((msg) {
32 port.close(); 34 port.close();
33 expect(msg, equals('re: hi there')); 35 expect(msg, equals('re: hi there'));
34 }); 36 });
35 }); 37 });
36 } 38 }
OLDNEW
« no previous file with comments | « tests/isolate/request_reply_test.dart ('k') | tests/isolate/spawn_function_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698