Chromium Code Reviews| 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" |