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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 43483004: Remove the reply port form the native isolate handler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to new isolate API Created 7 years, 2 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/include/dart_native_api.h ('k') | runtime/vm/dart_api_message.cc » ('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 63ea3a10014380cd50ba0025f9847da81123e9c2..fefdd51d684c49b4b94e8cbf492ed0302fadfbf5 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -5775,34 +5775,35 @@ TEST_CASE(ImportLibrary5) {
void NewNativePort_send123(Dart_Port dest_port_id,
- Dart_Port reply_port_id,
Dart_CObject *message) {
- // Gets a null message.
+ // Gets a send port message.
EXPECT_NOTNULL(message);
- EXPECT_EQ(Dart_CObject_kNull, message->type);
+ EXPECT_EQ(Dart_CObject_kArray, message->type);
+ EXPECT_EQ(Dart_CObject_kSendPort, message->value.as_array.values[0]->type);
// Post integer value.
Dart_CObject* response =
reinterpret_cast<Dart_CObject*>(Dart_ScopeAllocate(sizeof(Dart_CObject)));
response->type = Dart_CObject_kInt32;
response->value.as_int32 = 123;
- Dart_PostCObject(reply_port_id, response);
+ Dart_PostCObject(
+ message->value.as_array.values[0]->value.as_send_port, response);
}
void NewNativePort_send321(Dart_Port dest_port_id,
- Dart_Port reply_port_id,
Dart_CObject* message) {
// Gets a null message.
EXPECT_NOTNULL(message);
- EXPECT_EQ(Dart_CObject_kNull, message->type);
+ EXPECT_EQ(Dart_CObject_kSendPort, message->value.as_array.values[0]->type);
// Post integer value.
Dart_CObject* response =
reinterpret_cast<Dart_CObject*>(Dart_ScopeAllocate(sizeof(Dart_CObject)));
response->type = Dart_CObject_kInt32;
response->value.as_int32 = 321;
- Dart_PostCObject(reply_port_id, response);
+ Dart_PostCObject(
+ message->value.as_array.values[0]->value.as_send_port, response);
}
@@ -5820,7 +5821,8 @@ UNIT_TEST_CASE(NewNativePort) {
"import 'dart:isolate';\n"
"void callPort(SendPort port) {\n"
" var receivePort = new RawReceivePort();\n"
- " port.send(null, receivePort.sendPort);\n"
+ " var replyPort = receivePort.sendPort;\n"
+ " port.send([replyPort]);\n"
" receivePort.handler = (message) {\n"
" receivePort.close();\n"
" throw new Exception(message);\n"
« no previous file with comments | « runtime/include/dart_native_api.h ('k') | runtime/vm/dart_api_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698