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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 9325022: Decode the Dart message into a Dart_CMessage structure before calling the native port callback (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Undo unneeded changes 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 68926f215e78f316bb62a3fa03ed922eb95e3da5..8359aa2a099f325dac60039a962559a2da546ec6 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -2890,23 +2890,31 @@ TEST_CASE(ImportLibrary5) {
void NewNativePort_send123(Dart_Port dest_port_id,
Dart_Port reply_port_id,
- uint8_t* data) {
+ Dart_CObject *message) {
+ // Gets a null message.
+ EXPECT_NOTNULL(message);
+ EXPECT_EQ(Dart_CObject::kNull, message->type);
+
// Post integer value.
- Dart_CObject object;
- object.type = Dart_CObject::kInt32;
- object.value.as_int32 = 123;
- Dart_PostCObject(reply_port_id, &object);
+ Dart_CObject response;
+ response.type = Dart_CObject::kInt32;
+ response.value.as_int32 = 123;
+ Dart_PostCObject(reply_port_id, &response);
}
void NewNativePort_send321(Dart_Port dest_port_id,
Dart_Port reply_port_id,
- uint8_t* data) {
+ Dart_CObject* message) {
+ // Gets a null message.
+ EXPECT_NOTNULL(message);
+ EXPECT_EQ(Dart_CObject::kNull, message->type);
+
// Post integer value.
- Dart_CObject object;
- object.type = Dart_CObject::kInt32;
- object.value.as_int32 = 321;
- Dart_PostCObject(reply_port_id, &object);
+ Dart_CObject response;
+ response.type = Dart_CObject::kInt32;
+ response.value.as_int32 = 321;
+ Dart_PostCObject(reply_port_id, &response);
}

Powered by Google App Engine
This is Rietveld 408576698