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

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: 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
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/dart_api_message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b28aed7ff723155384426a34b498595d50971808..c1b105b6d621ad186088d790a080081bfe394f54 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);
}
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/dart_api_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698