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..bd8dcaaaa76a021a422b1f804b4cf3eaa54d7205 100644 |
--- a/runtime/vm/dart_api_impl_test.cc |
+++ b/runtime/vm/dart_api_impl_test.cc |
@@ -2828,16 +2828,22 @@ 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_PostCObject(reply_port_id, &object); |
} |
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_PostCObject(reply_port_id, &object); |
} |
@@ -2854,7 +2860,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); |