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

Side by Side Diff: runtime/vm/custom_isolate_test.cc

Issue 9652001: SendPort + ReceivePort changes: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 months 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 | « runtime/lib/isolate.dart ('k') | runtime/vm/dart_api_impl_test.cc » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 // Custom Isolate Test. 9 // Custom Isolate Test.
10 // 10 //
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 " echo('Running isolateMain');\n" 58 " echo('Running isolateMain');\n"
59 " mainPort.receive((message, SendPort replyTo) {\n" 59 " mainPort.receive((message, SendPort replyTo) {\n"
60 " echo('Received: ' + message);\n" 60 " echo('Received: ' + message);\n"
61 " replyTo.send((message + 1), null);\n" 61 " replyTo.send((message + 1), null);\n"
62 " });\n" 62 " });\n"
63 "}\n" 63 "}\n"
64 "\n" 64 "\n"
65 "main() {\n" 65 "main() {\n"
66 " var isolate = new CustomIsolate(\"isolateMain\");\n" 66 " var isolate = new CustomIsolate(\"isolateMain\");\n"
67 " isolate.spawn().then((SendPort port) {\n" 67 " isolate.spawn().then((SendPort port) {\n"
68 " port.call(42).receive((message, replyTo) {\n" 68 " port.call(42).then((message) {\n"
69 " echo('Received: ' + message);\n" 69 " echo('Received: ' + message);\n"
70 " });\n" 70 " });\n"
71 " });\n" 71 " });\n"
72 " return 'success';\n" 72 " return 'success';\n"
73 "}\n"; 73 "}\n";
74 74
75 75
76 // An entry in our event queue. 76 // An entry in our event queue.
77 class Event { 77 class Event {
78 protected: 78 protected:
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 OS::Print("-- Finished event loop --\n"); 345 OS::Print("-- Finished event loop --\n");
346 EXPECT_STREQ("Received: 43", saved_echo); 346 EXPECT_STREQ("Received: 43", saved_echo);
347 free(const_cast<char*>(saved_echo)); 347 free(const_cast<char*>(saved_echo));
348 348
349 delete event_queue; 349 delete event_queue;
350 } 350 }
351 351
352 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 352 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
353 353
354 } // namespace dart 354 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/isolate.dart ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698