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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 Dart_Handle send_port = Dart_NewSendPort(main_port_id); | 305 Dart_Handle send_port = Dart_NewSendPort(main_port_id); |
306 EXPECT_VALID(send_port); | 306 EXPECT_VALID(send_port); |
307 Dart_SetReturnValue(args, send_port); | 307 Dart_SetReturnValue(args, send_port); |
308 | 308 |
309 OS::Print("-- Exit: CustomIsolateImpl_start --\n"); | 309 OS::Print("-- Exit: CustomIsolateImpl_start --\n"); |
310 Dart_ExitScope(); | 310 Dart_ExitScope(); |
311 } | 311 } |
312 | 312 |
313 | 313 |
314 UNIT_TEST_CASE(CustomIsolates) { | 314 UNIT_TEST_CASE(CustomIsolates) { |
| 315 FLAG_verify_handles = true; |
| 316 FLAG_verify_on_transition = true; |
315 event_queue = new EventQueue(); | 317 event_queue = new EventQueue(); |
316 | 318 |
317 Dart_Isolate dart_isolate = TestCase::CreateTestIsolate(); | 319 Dart_Isolate dart_isolate = TestCase::CreateTestIsolate(); |
318 EXPECT(dart_isolate != NULL); | 320 EXPECT(dart_isolate != NULL); |
319 Dart_SetMessageNotifyCallback(&NotifyMessage); | 321 Dart_SetMessageNotifyCallback(&NotifyMessage); |
320 Dart_EnterScope(); | 322 Dart_EnterScope(); |
321 Dart_Handle result; | 323 Dart_Handle result; |
322 | 324 |
323 // Create a test library. | 325 // Create a test library. |
324 Dart_Handle lib = TestCase::LoadTestScript(kCustomIsolateScriptChars, | 326 Dart_Handle lib = TestCase::LoadTestScript(kCustomIsolateScriptChars, |
(...skipping 19 matching lines...) Expand all Loading... |
344 event = event_queue->Get(); | 346 event = event_queue->Get(); |
345 } | 347 } |
346 OS::Print("-- Finished event loop --\n"); | 348 OS::Print("-- Finished event loop --\n"); |
347 EXPECT_STREQ("Received: 43", saved_echo); | 349 EXPECT_STREQ("Received: 43", saved_echo); |
348 free(const_cast<char*>(saved_echo)); | 350 free(const_cast<char*>(saved_echo)); |
349 | 351 |
350 delete event_queue; | 352 delete event_queue; |
351 } | 353 } |
352 | 354 |
353 } // namespace dart | 355 } // namespace dart |
OLD | NEW |