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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 8297004: Allow embedders to provide custom message delivery for an isolate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.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
===================================================================
--- runtime/vm/dart_api_impl_test.cc (revision 513)
+++ runtime/vm/dart_api_impl_test.cc (working copy)
@@ -448,6 +448,29 @@
}
+static bool MyPostMessageCallback(Dart_Isolate dest_isolate,
+ Dart_Port send_port,
+ Dart_Port reply_port,
+ Dart_Message message) {
+ return true;
+}
+
+
+static void MyClosePortCallback(Dart_Isolate dest_isolate,
+ Dart_Port port) {
+}
+
+
+UNIT_TEST_CASE(SetMessageCallbacks) {
+ Dart_Isolate dart_isolate = Dart_CreateIsolate(NULL, NULL);
+ Dart_SetMessageCallbacks(&MyPostMessageCallback, &MyClosePortCallback);
+ Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate);
+ EXPECT_EQ(&MyPostMessageCallback, isolate->post_message_callback());
+ EXPECT_EQ(&MyClosePortCallback, isolate->close_port_callback());
+ Dart_ShutdownIsolate();
+}
+
+
#if defined(TARGET_ARCH_IA32) // only ia32 can run execution tests.
UNIT_TEST_CASE(FieldAccess) {
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698