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)); |
} |