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

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: 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
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 3524d71d498f9b03b90ad9e54ed790521a0450b5..d9b496563cb69d2ccd81e220ef9e80066b0b9d36 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -5736,34 +5736,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);
}
@@ -5781,7 +5782,8 @@ UNIT_TEST_CASE(NewNativePort) {
"import 'dart:isolate';\n"
"void callPort(SendPort port) {\n"
" var receivePort = new ReceivePort();\n"
- " port.send(null, receivePort.toSendPort());\n"
+ " var replyPort = receivePort.toSendPort();\n"
floitsch 2013/10/25 18:04:58 This will have to be merged with the isolate API.
Søren Gjesse 2013/10/29 07:42:57 Done.
+ " port.send([replyPort]);\n"
" receivePort.receive((message, _) {\n"
" receivePort.close();\n"
" throw new Exception(message);\n"

Powered by Google App Engine
This is Rietveld 408576698