| Index: runtime/vm/service_test.cc
|
| diff --git a/runtime/vm/service_test.cc b/runtime/vm/service_test.cc
|
| index 31efafc915864179d618b3a9375d612a71d321cf..c59c4c69aef303fffd48e4911094d93a01f636a7 100644
|
| --- a/runtime/vm/service_test.cc
|
| +++ b/runtime/vm/service_test.cc
|
| @@ -506,6 +506,7 @@ TEST_CASE(Service_EmbedderRootHandler) {
|
| EXPECT_STREQ("{\"result\":beta, \"id\":\"0\"}", handler.msg());
|
| }
|
|
|
| +
|
| TEST_CASE(Service_EmbedderIsolateHandler) {
|
| const char* kScript =
|
| "var port;\n" // Set to our mock port by C++.
|
| @@ -544,6 +545,33 @@ TEST_CASE(Service_EmbedderIsolateHandler) {
|
| }
|
|
|
|
|
| +static uint8_t* AllocMsg(const char* str) {
|
| + return reinterpret_cast<uint8_t*>(strdup(str));
|
| +}
|
| +
|
| +
|
| +TEST_CASE(Service_MessageQueue) {
|
| + MessageQueue queue;
|
| + EXPECT(queue.IsEmpty());
|
| +
|
| + Dart_Port port = 1;
|
| +
|
| + const char* str1 = "msg1";
|
| +
|
| + // Add a message.
|
| + Message* msg1 = new Message(
|
| + port, AllocMsg(str1), strlen(str1) + 1, Message::kNormalPriority);
|
| + queue.Enqueue(msg1, false);
|
| + EXPECT(queue.Length() == 1);
|
| + EXPECT(!queue.IsEmpty());
|
| +
|
| + // Print MessageQueue to JSON.
|
| + JSONStream stream;
|
| + queue.PrintJSON(&stream);
|
| + // Expect a Message type.
|
| + EXPECT_SUBSTRING("\"type\":\"Message\"", stream.ToCString());
|
| +}
|
| +
|
| // TODO(zra): Remove when tests are ready to enable.
|
| #if !defined(TARGET_ARCH_ARM64)
|
|
|
|
|