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 b91fb1223aba96c80055e35d890568d4afa8deb9..306ca8832bf2f2b8f8ac6fa5af6ba687b5337243 100644 |
--- a/runtime/vm/dart_api_impl_test.cc |
+++ b/runtime/vm/dart_api_impl_test.cc |
@@ -7141,6 +7141,20 @@ void NewNativePort_send321(Dart_Port dest_port_id, |
} |
+TEST_CASE(IllegalNewSendPort) { |
+ Dart_Handle error = Dart_NewSendPort(ILLEGAL_PORT); |
+ EXPECT(Dart_IsError(error)); |
+ EXPECT(Dart_IsApiError(error)); |
+} |
+ |
+ |
+TEST_CASE(IllegalPost) { |
+ Dart_Handle message = Dart_True(); |
+ bool success = Dart_Post(ILLEGAL_PORT, message); |
+ EXPECT(!success); |
+} |
+ |
+ |
UNIT_TEST_CASE(NewNativePort) { |
// Create a port with a bogus handler. |
Dart_Port error_port = Dart_NewNativePort("Foo", NULL, true); |