OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "platform/assert.h" | 6 #include "platform/assert.h" |
7 #include "platform/json.h" | 7 #include "platform/json.h" |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
(...skipping 6263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6274 } | 6274 } |
6275 Dart_Isolate isolate = TestCase::CreateTestIsolate(); | 6275 Dart_Isolate isolate = TestCase::CreateTestIsolate(); |
6276 ASSERT(isolate != NULL); | 6276 ASSERT(isolate != NULL); |
6277 Dart_EnterScope(); | 6277 Dart_EnterScope(); |
6278 Dart_Handle url = NewString(TestCase::url()); | 6278 Dart_Handle url = NewString(TestCase::url()); |
6279 Dart_Handle source = NewString(kScriptChars); | 6279 Dart_Handle source = NewString(kScriptChars); |
6280 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); | 6280 Dart_Handle result = Dart_SetLibraryTagHandler(TestCase::library_handler); |
6281 EXPECT_VALID(result); | 6281 EXPECT_VALID(result); |
6282 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); | 6282 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); |
6283 EXPECT_VALID(lib); | 6283 EXPECT_VALID(lib); |
| 6284 Dart_ExitIsolate(); |
| 6285 bool retval = Dart_MakeIsolateRunnable(isolate); |
| 6286 Dart_EnterIsolate(isolate); |
| 6287 EXPECT(retval); |
6284 Dart_ExitScope(); | 6288 Dart_ExitScope(); |
6285 return true; | 6289 return true; |
6286 } | 6290 } |
6287 | 6291 |
6288 | 6292 |
6289 // The error string from the last unhandled exception. This value is only | 6293 // The error string from the last unhandled exception. This value is only |
6290 // valid until the next Dart_ExitScope(). | 6294 // valid until the next Dart_ExitScope(). |
6291 static char* last_exception = NULL; | 6295 static char* last_exception = NULL; |
6292 | 6296 |
6293 | 6297 |
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7539 NULL); | 7543 NULL); |
7540 int64_t value = 0; | 7544 int64_t value = 0; |
7541 result = Dart_IntegerToInt64(result, &value); | 7545 result = Dart_IntegerToInt64(result, &value); |
7542 EXPECT_VALID(result); | 7546 EXPECT_VALID(result); |
7543 EXPECT_EQ(260, value); | 7547 EXPECT_EQ(260, value); |
7544 } | 7548 } |
7545 | 7549 |
7546 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 7550 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
7547 | 7551 |
7548 } // namespace dart | 7552 } // namespace dart |
OLD | NEW |