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

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: Addressed review comments from asiva@ Created 8 years, 10 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..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);

Powered by Google App Engine
This is Rietveld 408576698