Chromium Code Reviews| Index: runtime/vm/port_test.cc |
| diff --git a/runtime/vm/port_test.cc b/runtime/vm/port_test.cc |
| index 165d19c13848c69935e66937b5b11ba3cfc84148..444328b71d022bb1508028f4af5bf2dad0dce082 100644 |
| --- a/runtime/vm/port_test.cc |
| +++ b/runtime/vm/port_test.cc |
| @@ -151,6 +151,36 @@ TEST_CASE(PortMap_PostMessage) { |
| } |
| +TEST_CASE(PortMap_PostIntegerMessage) { |
| + PortTestMessageHandler handler; |
| + Dart_Port port = PortMap::CreatePort(&handler); |
| + EXPECT_EQ(0, handler.notify_count); |
| + |
| + EXPECT(PortMap::PostMessage(new Message( |
| + port, reinterpret_cast<uint8_t*>(Smi::New(42)), 0, |
|
Ivan Posva
2015/12/11 21:02:39
Shortcut constructor?
zra
2015/12/11 22:01:31
Done.
|
| + Message::kNormalPriority))); |
| + |
| + // Check that the message notify callback was called. |
| + EXPECT_EQ(1, handler.notify_count); |
| + PortMap::ClosePorts(&handler); |
| +} |
| + |
| + |
| +TEST_CASE(PortMap_PostNullMessage) { |
| + PortTestMessageHandler handler; |
| + Dart_Port port = PortMap::CreatePort(&handler); |
| + EXPECT_EQ(0, handler.notify_count); |
| + |
| + EXPECT(PortMap::PostMessage(new Message( |
| + port, reinterpret_cast<uint8_t*>(Object::null()), 0, |
|
Ivan Posva
2015/12/11 21:02:39
ditto
zra
2015/12/11 22:01:31
Done.
|
| + Message::kNormalPriority))); |
| + |
| + // Check that the message notify callback was called. |
| + EXPECT_EQ(1, handler.notify_count); |
| + PortMap::ClosePorts(&handler); |
| +} |
| + |
| + |
| TEST_CASE(PortMap_PostMessageClosedPort) { |
| // Create a port id and make it invalid. |
| PortTestMessageHandler handler; |