| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_native_api.h" | 6 #include "include/dart_native_api.h" |
| 7 | 7 |
| 8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 9 | 9 |
| 10 // Custom Isolate Test. | 10 // Custom Isolate Test. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 Dart_EnterIsolate(isolate()); | 203 Dart_EnterIsolate(isolate()); |
| 204 Dart_EnterScope(); | 204 Dart_EnterScope(); |
| 205 | 205 |
| 206 Dart_Handle result = Dart_HandleMessage(); | 206 Dart_Handle result = Dart_HandleMessage(); |
| 207 EXPECT_VALID(result); | 207 EXPECT_VALID(result); |
| 208 | 208 |
| 209 if (!Dart_HasLivePorts()) { | 209 if (!Dart_HasLivePorts()) { |
| 210 OS::Print("<< Shutting down isolate(%p)\n", isolate()); | 210 OS::Print("<< Shutting down isolate(%p)\n", isolate()); |
| 211 event_queue->RemoveEventsForIsolate(isolate()); | 211 event_queue->RemoveEventsForIsolate(isolate()); |
| 212 Dart_SetMessageNotifyCallback(NULL); | 212 Dart_SetMessageNotifyCallback(NULL); |
| 213 Dart_ExitIsolate(); |
| 213 Dart_ShutdownIsolate(); | 214 Dart_ShutdownIsolate(); |
| 214 } else { | 215 } else { |
| 215 Dart_ExitScope(); | 216 Dart_ExitScope(); |
| 216 Dart_ExitIsolate(); | 217 Dart_ExitIsolate(); |
| 217 } | 218 } |
| 218 ASSERT(Dart_CurrentIsolate() == NULL); | 219 ASSERT(Dart_CurrentIsolate() == NULL); |
| 219 } | 220 } |
| 220 | 221 |
| 221 | 222 |
| 222 static void NotifyMessage(Dart_Isolate dest_isolate) { | 223 static void NotifyMessage(Dart_Isolate dest_isolate) { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 351 } |
| 351 OS::Print("-- Finished event loop --\n"); | 352 OS::Print("-- Finished event loop --\n"); |
| 352 EXPECT_STREQ("Received: 43", saved_echo); | 353 EXPECT_STREQ("Received: 43", saved_echo); |
| 353 free(saved_echo); | 354 free(saved_echo); |
| 354 | 355 |
| 355 delete event_queue; | 356 delete event_queue; |
| 356 event_queue = NULL; | 357 event_queue = NULL; |
| 357 } | 358 } |
| 358 | 359 |
| 359 } // namespace dart | 360 } // namespace dart |
| OLD | NEW |