| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 OS::Print("-- Notify isolate(%p) of pending message --\n", dest_isolate); | 223 OS::Print("-- Notify isolate(%p) of pending message --\n", dest_isolate); |
| 224 OS::Print("-- Adding MessageEvent to queue --\n"); | 224 OS::Print("-- Adding MessageEvent to queue --\n"); |
| 225 event_queue->Add(new MessageEvent(dest_isolate)); | 225 event_queue->Add(new MessageEvent(dest_isolate)); |
| 226 } | 226 } |
| 227 | 227 |
| 228 | 228 |
| 229 static Dart_NativeFunction NativeLookup(Dart_Handle name, | 229 static Dart_NativeFunction NativeLookup(Dart_Handle name, |
| 230 int argc, | 230 int argc, |
| 231 bool* auto_setup_scope) { | 231 bool* auto_setup_scope) { |
| 232 ASSERT(auto_setup_scope != NULL); | 232 ASSERT(auto_setup_scope != NULL); |
| 233 *auto_setup_scope = false; | 233 *auto_setup_scope = true; |
| 234 const char* name_str = NULL; | 234 const char* name_str = NULL; |
| 235 EXPECT(Dart_IsString(name)); | 235 EXPECT(Dart_IsString(name)); |
| 236 EXPECT_VALID(Dart_StringToCString(name, &name_str)); | 236 EXPECT_VALID(Dart_StringToCString(name, &name_str)); |
| 237 if (strcmp(name_str, "native_echo") == 0) { | 237 if (strcmp(name_str, "native_echo") == 0) { |
| 238 return &native_echo; | 238 return &native_echo; |
| 239 } else if (strcmp(name_str, "CustomIsolateImpl_start") == 0) { | 239 } else if (strcmp(name_str, "CustomIsolateImpl_start") == 0) { |
| 240 return &CustomIsolateImpl_start; | 240 return &CustomIsolateImpl_start; |
| 241 } | 241 } |
| 242 return NULL; | 242 return NULL; |
| 243 } | 243 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 OS::Print("-- Finished event loop --\n"); | 351 OS::Print("-- Finished event loop --\n"); |
| 352 EXPECT_STREQ("Received: 43", saved_echo); | 352 EXPECT_STREQ("Received: 43", saved_echo); |
| 353 free(saved_echo); | 353 free(saved_echo); |
| 354 | 354 |
| 355 delete event_queue; | 355 delete event_queue; |
| 356 event_queue = NULL; | 356 event_queue = NULL; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace dart | 359 } // namespace dart |
| OLD | NEW |