| Index: runtime/vm/port_test.cc
|
| diff --git a/runtime/vm/port_test.cc b/runtime/vm/port_test.cc
|
| index 165d19c13848c69935e66937b5b11ba3cfc84148..ab58d80d2b2dd69f7355a12c57b613185a3566f2 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,
|
| + Message::kNormalPriority)));
|
| +
|
| + // Check that the message notify callback was called.
|
| + EXPECT_EQ(1, handler.notify_count);
|
| + PortMap::ClosePorts(&handler);
|
| +}
|
| +
|
| +
|
| +TEST_CASE(PortMap_PostSimpleMessage) {
|
| + PortTestMessageHandler handler;
|
| + Dart_Port port = PortMap::CreatePort(&handler);
|
| + EXPECT_EQ(0, handler.notify_count);
|
| +
|
| + EXPECT(PortMap::PostMessage(new Message(
|
| + port, reinterpret_cast<uint8_t*>(Bool::False().raw()), 0,
|
| + 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;
|
|
|