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

Side by Side Diff: vm/message_queue_test.cc

Issue 8334031: - Fix the snapshot generation python script to return an error code when snapshot generation fail... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 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 | « vm/dart_api_impl.cc ('k') | vm/port_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 "vm/assert.h" 5 #include "vm/assert.h"
6 #include "vm/message_queue.h" 6 #include "vm/message_queue.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 delete msg1; 51 delete msg1;
52 delete msg2; 52 delete msg2;
53 } 53 }
54 54
55 55
56 // A thread which receives an expected sequence of messages. 56 // A thread which receives an expected sequence of messages.
57 static Monitor* sync = NULL; 57 static Monitor* sync = NULL;
58 static MessageQueue* shared_queue = NULL; 58 static MessageQueue* shared_queue = NULL;
59 void MessageReceiver_start(uword unused) { 59 void MessageReceiver_start(uword unused) {
60 // We only need an isolate here because the MonitorLocker in the 60 // We only need an isolate here because the MonitorLocker in the
61 // MessageQueue expects it. 61 // MessageQueue expects it, we don't need to initialize the isolate
62 Dart::CreateIsolate(NULL, NULL); 62 // as it does not run any dart code.
63 Dart::CreateIsolate();
63 64
64 // Create a message queue and share it. 65 // Create a message queue and share it.
65 MessageQueue* queue = new MessageQueue(); 66 MessageQueue* queue = new MessageQueue();
66 MessageQueueTestPeer peer(queue); 67 MessageQueueTestPeer peer(queue);
67 shared_queue = queue; 68 shared_queue = queue;
68 69
69 // Tell the other thread that the shared queue is ready. 70 // Tell the other thread that the shared queue is ready.
70 { 71 {
71 MonitorLocker ml(sync); 72 MonitorLocker ml(sync);
72 ml.Notify(); 73 ml.Notify();
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 220
220 EXPECT(!queue_peer.HasMessage()); 221 EXPECT(!queue_peer.HasMessage());
221 queue.Flush(port1); 222 queue.Flush(port1);
222 223
223 // Queue is still empty. 224 // Queue is still empty.
224 EXPECT(!queue_peer.HasMessage()); 225 EXPECT(!queue_peer.HasMessage());
225 } 226 }
226 227
227 228
228 } // namespace dart 229 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/port_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698