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

Side by Side Diff: dart/tests/isolate/browser/typed_data_message_test.dart

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 | « dart/tests/html/typed_arrays_simd_test.dart ('k') | dart/tests/isolate/isolate.status » ('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 // Dart test program for testing serialization of messages. 5 // Dart test program for testing serialization of messages.
6 // VMOptions=--enable_type_checks --enable_asserts 6 // VMOptions=--enable_type_checks --enable_asserts
7 7
8 library TypedDataMessageTest; 8 library TypedDataMessageTest;
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:typed_data'; 10 import 'dart:typed_data';
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 pingPong(SendPort initialReplyTo) { 59 pingPong(SendPort initialReplyTo) {
60 var port = new ReceivePort(); 60 var port = new ReceivePort();
61 initialReplyTo.send(port.sendPort); 61 initialReplyTo.send(port.sendPort);
62 initializeList(); 62 initializeList();
63 int count = 0; 63 int count = 0;
64 port.listen((var message) { 64 port.listen((var message) {
65 var data = message[0]; 65 var data = message[0];
66 SendPort replyTo = message[1]; 66 SendPort replyTo = message[1];
67 if (data == -1) { 67 if (data == -1) {
68 port.close(); 68 port.close();
69 replyTo.send(count, null); 69 replyTo.send(count);
70 } else { 70 } else {
71 // Check if the received object is correct. 71 // Check if the received object is correct.
72 if (count < elements.length) { 72 if (count < elements.length) {
73 VerifyObject(count, data); 73 VerifyObject(count, data);
74 } 74 }
75 // Bounce the received object back so that the sender 75 // Bounce the received object back so that the sender
76 // can make sure that the object matches. 76 // can make sure that the object matches.
77 replyTo.send(data, null); 77 replyTo.send(data);
78 count++; 78 count++;
79 } 79 }
80 }); 80 });
81 } 81 }
82 82
83 Future sendReceive(SendPort port, msg) { 83 Future sendReceive(SendPort port, msg) {
84 ReceivePort response = new ReceivePort(); 84 ReceivePort response = new ReceivePort();
85 port.send([msg, response.sendPort]); 85 port.send([msg, response.sendPort]);
86 return response.first; 86 return response.first;
87 } 87 }
(...skipping 13 matching lines...) Expand all
101 })); 101 }));
102 } 102 }
103 103
104 // Shutdown the MessageServer. 104 // Shutdown the MessageServer.
105 sendReceive(remote, -1).then(expectAsync1((int message) { 105 sendReceive(remote, -1).then(expectAsync1((int message) {
106 expect(message, elements.length); 106 expect(message, elements.length);
107 })); 107 }));
108 }); 108 });
109 }); 109 });
110 } 110 }
OLDNEW
« no previous file with comments | « dart/tests/html/typed_arrays_simd_test.dart ('k') | dart/tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698