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('dart:isolate'); | 6 #import('dart:isolate'); |
7 #import('../../pkg/unittest/unittest.dart'); | 7 #import('../../pkg/unittest/unittest.dart'); |
8 | 8 |
9 void countMessages() { | 9 void countMessages() { |
10 int count = 0; | 10 int count = 0; |
(...skipping 22 matching lines...) Expand all Loading... |
33 Expect.equals(11, count); | 33 Expect.equals(11, count); |
34 local.close(); | 34 local.close(); |
35 return; | 35 return; |
36 } | 36 } |
37 | 37 |
38 Expect.equals((count - 1) * 2, message); | 38 Expect.equals((count - 1) * 2, message); |
39 remote.send(count++, reply); | 39 remote.send(count++, reply); |
40 if (count == 10) { | 40 if (count == 10) { |
41 remote.send(-1, reply); | 41 remote.send(-1, reply); |
42 } | 42 } |
43 }, count: 11)); | 43 }, 11)); |
44 remote.send(count++, reply); | 44 remote.send(count++, reply); |
45 }); | 45 }); |
46 } | 46 } |
OLD | NEW |