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 import 'dart:isolate'; | 5 import 'dart:isolate'; |
6 | 6 |
7 class Fields { | 7 class Fields { |
8 Fields(int i, int j) : fld1 = i, fld2 = j, fld5 = true {} | 8 Fields(int i, int j) : fld1 = i, fld2 = j, fld5 = true {} |
9 int fld1; | 9 int fld1; |
10 final int fld2; | 10 final int fld2; |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 var idx = i; | 1310 var idx = i; |
1311 remote.call(sentObject).then(expectAsync1((var receivedObject) { | 1311 remote.call(sentObject).then(expectAsync1((var receivedObject) { |
1312 MessageTest.VerifyObject(idx, receivedObject); | 1312 MessageTest.VerifyObject(idx, receivedObject); |
1313 })); | 1313 })); |
1314 } | 1314 } |
1315 | 1315 |
1316 // Send recursive objects and receive them back. | 1316 // Send recursive objects and receive them back. |
1317 List local_list1 = ["Hello", "World", "Hello", 0xffffffffff]; | 1317 List local_list1 = ["Hello", "World", "Hello", 0xffffffffff]; |
1318 List local_list2 = [null, local_list1, local_list1 ]; | 1318 List local_list2 = [null, local_list1, local_list1 ]; |
1319 List local_list3 = [local_list2, 2.0, true, false, 0xffffffffff]; | 1319 List local_list3 = [local_list2, 2.0, true, false, 0xffffffffff]; |
1320 List sendObject = new List(5); | 1320 List sendObject = new List.fixedLength(5); |
1321 sendObject[0] = local_list1; | 1321 sendObject[0] = local_list1; |
1322 sendObject[1] = sendObject; | 1322 sendObject[1] = sendObject; |
1323 sendObject[2] = local_list2; | 1323 sendObject[2] = local_list2; |
1324 sendObject[3] = sendObject; | 1324 sendObject[3] = sendObject; |
1325 sendObject[4] = local_list3; | 1325 sendObject[4] = local_list3; |
1326 remote.call(sendObject).then((var replyObject) { | 1326 remote.call(sendObject).then((var replyObject) { |
1327 Expect.equals(true, sendObject is List); | 1327 Expect.equals(true, sendObject is List); |
1328 Expect.equals(true, replyObject is List); | 1328 Expect.equals(true, replyObject is List); |
1329 Expect.equals(sendObject.length, replyObject.length); | 1329 Expect.equals(sendObject.length, replyObject.length); |
1330 Expect.equals(true, identical(replyObject[1], replyObject)); | 1330 Expect.equals(true, identical(replyObject[1], replyObject)); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 void processLines() { | 1548 void processLines() { |
1549 port.receive((message, SendPort replyTo) { | 1549 port.receive((message, SendPort replyTo) { |
1550 if (message == TERMINATION_MESSAGE) { | 1550 if (message == TERMINATION_MESSAGE) { |
1551 assert(replyTo == null); | 1551 assert(replyTo == null); |
1552 port.close(); | 1552 port.close(); |
1553 } else { | 1553 } else { |
1554 replyTo.send(processLine(message), null); | 1554 replyTo.send(processLine(message), null); |
1555 } | 1555 } |
1556 }); | 1556 }); |
1557 } | 1557 } |
OLD | NEW |