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

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

Issue 1371193005: VM restart + shutdown fixes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: more code review Created 5 years, 2 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
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('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 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/lockers.h" 6 #include "vm/lockers.h"
7 #include "vm/message_handler.h" 7 #include "vm/message_handler.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 #include "vm/port.h" 9 #include "vm/port.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 20 matching lines...) Expand all
31 31
32 32
33 class PortTestMessageHandler : public MessageHandler { 33 class PortTestMessageHandler : public MessageHandler {
34 public: 34 public:
35 PortTestMessageHandler() : notify_count(0) {} 35 PortTestMessageHandler() : notify_count(0) {}
36 36
37 void MessageNotify(Message::Priority priority) { 37 void MessageNotify(Message::Priority priority) {
38 notify_count++; 38 notify_count++;
39 } 39 }
40 40
41 bool HandleMessage(Message* message) { return true; } 41 MessageStatus HandleMessage(Message* message) { return kOK; }
42 42
43 int notify_count; 43 int notify_count;
44 }; 44 };
45 45
46 46
47 TEST_CASE(PortMap_CreateAndCloseOnePort) { 47 TEST_CASE(PortMap_CreateAndCloseOnePort) {
48 PortTestMessageHandler handler; 48 PortTestMessageHandler handler;
49 Dart_Port port = PortMap::CreatePort(&handler); 49 Dart_Port port = PortMap::CreatePort(&handler);
50 EXPECT_NE(0, port); 50 EXPECT_NE(0, port);
51 EXPECT(PortMapTestPeer::IsActivePort(port)); 51 EXPECT(PortMapTestPeer::IsActivePort(port));
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 159
160 const char* message = "msg"; 160 const char* message = "msg";
161 intptr_t message_len = strlen(message) + 1; 161 intptr_t message_len = strlen(message) + 1;
162 162
163 EXPECT(!PortMap::PostMessage(new Message( 163 EXPECT(!PortMap::PostMessage(new Message(
164 port, reinterpret_cast<uint8_t*>(strdup(message)), message_len, 164 port, reinterpret_cast<uint8_t*>(strdup(message)), message_len,
165 Message::kNormalPriority))); 165 Message::kNormalPriority)));
166 } 166 }
167 167
168 } // namespace dart 168 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698