Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 9104041: Added API Dart_PostCMessage for posting a Dart_CMessage structure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added new API Dart_PostCMessage Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698