OLD | NEW |
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 library CountTest; | 5 library CountTest; |
6 import '../../pkg/unittest/lib/unittest.dart'; | 6 import '../../pkg/unittest/lib/unittest.dart'; |
7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
8 | 8 |
9 void countMessages() { | 9 void countMessages() { |
10 int count = 0; | 10 int count = 0; |
(...skipping 28 matching lines...) Expand all Loading... |
39 expect(count, 11); | 39 expect(count, 11); |
40 local.close(); | 40 local.close(); |
41 return; | 41 return; |
42 } | 42 } |
43 | 43 |
44 expect(message, (count - 1) * 2); | 44 expect(message, (count - 1) * 2); |
45 remote.send(count++, reply); | 45 remote.send(count++, reply); |
46 if (count == 10) { | 46 if (count == 10) { |
47 remote.send(-1, reply); | 47 remote.send(-1, reply); |
48 } | 48 } |
49 }, 11)); | 49 }, count: 11)); |
50 remote.send(count++, reply); | 50 remote.send(count++, reply); |
51 }); | 51 }); |
52 } | 52 } |
OLD | NEW |