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

Unified Diff: runtime/vm/port_test.cc

Issue 456983002: Refactor isolate startup code in preparation for making isolate spawning more truly non-blocking. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/port.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/port_test.cc
diff --git a/runtime/vm/port_test.cc b/runtime/vm/port_test.cc
index 64252dc3abf605d6d1898e434390a52c43e2aa66..34272d150b7b884d2d42ccd9fa047a247d732ff7 100644
--- a/runtime/vm/port_test.cc
+++ b/runtime/vm/port_test.cc
@@ -25,7 +25,7 @@ class PortMapTestPeer {
if (index < 0) {
return false;
}
- return PortMap::map_[index].live;
+ return PortMap::map_[index].state == PortMap::kLivePort;
}
};
@@ -100,20 +100,36 @@ TEST_CASE(PortMap_CreateManyPorts) {
}
-TEST_CASE(PortMap_SetLive) {
+TEST_CASE(PortMap_SetPortState) {
PortTestMessageHandler handler;
+
+ // Regular port.
Dart_Port port = PortMap::CreatePort(&handler);
EXPECT_NE(0, port);
EXPECT(PortMapTestPeer::IsActivePort(port));
EXPECT(!PortMapTestPeer::IsLivePort(port));
- PortMap::SetLive(port);
+ PortMap::SetPortState(port, PortMap::kLivePort);
EXPECT(PortMapTestPeer::IsActivePort(port));
EXPECT(PortMapTestPeer::IsLivePort(port));
PortMap::ClosePort(port);
EXPECT(!PortMapTestPeer::IsActivePort(port));
EXPECT(!PortMapTestPeer::IsLivePort(port));
+
+ // Control port.
+ port = PortMap::CreatePort(&handler);
+ EXPECT_NE(0, port);
+ EXPECT(PortMapTestPeer::IsActivePort(port));
+ EXPECT(!PortMapTestPeer::IsLivePort(port));
+
+ PortMap::SetPortState(port, PortMap::kControlPort);
+ EXPECT(PortMapTestPeer::IsActivePort(port));
+ EXPECT(!PortMapTestPeer::IsLivePort(port));
+
+ PortMap::ClosePort(port);
+ EXPECT(!PortMapTestPeer::IsActivePort(port));
+ EXPECT(!PortMapTestPeer::IsLivePort(port));
}
« no previous file with comments | « runtime/vm/port.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698