Index: runtime/vm/dart_api_impl_test.cc |
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc |
index f42dd48a262123cf02a5be09a50a451f1bc63989..5c40fdceca945201d6f34b6568aedb370123c9da 100644 |
--- a/runtime/vm/dart_api_impl_test.cc |
+++ b/runtime/vm/dart_api_impl_test.cc |
@@ -2828,16 +2828,26 @@ TEST_CASE(ImportLibrary5) { |
void NewNativePort_send123(Dart_Port dest_port_id, |
Dart_Port reply_port_id, |
uint8_t* data) { |
- intptr_t response = 123; |
- Dart_PostIntArray(reply_port_id, 1, &response); |
+ // Post integer value. |
+ Dart_CObject object; |
+ object.type = Dart_CObject::kInt32; |
+ object.value.as_int32 = 123; |
+ Dart_CMessage message; |
+ message.root = &object; |
+ Dart_PostCMessage(reply_port_id, &message); |
} |
void NewNativePort_send321(Dart_Port dest_port_id, |
Dart_Port reply_port_id, |
uint8_t* data) { |
- intptr_t response = 321; |
- Dart_PostIntArray(reply_port_id, 1, &response); |
+ // Post integer value. |
+ Dart_CObject object; |
+ object.type = Dart_CObject::kInt32; |
+ object.value.as_int32 = 321; |
+ Dart_CMessage message; |
+ message.root = &object; |
+ Dart_PostCMessage(reply_port_id, &message); |
} |
@@ -2854,7 +2864,7 @@ UNIT_TEST_CASE(NewNativePort) { |
const char* kScriptChars = |
"void callPort(SendPort port) {\n" |
" port.call(null).receive((message, replyTo) {\n" |
- " throw new Exception(message[0]);\n" |
+ " throw new Exception(message);\n" |
" });\n" |
"}\n"; |
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |