| 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_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 Dart_ExitScope(); | 729 Dart_ExitScope(); |
| 730 } | 730 } |
| 731 | 731 |
| 732 { | 732 { |
| 733 // Create an Isolate using the full snapshot, load a script and create | 733 // Create an Isolate using the full snapshot, load a script and create |
| 734 // a script snapshot of the script. | 734 // a script snapshot of the script. |
| 735 TestCase::CreateTestIsolateFromSnapshot(full_snapshot); | 735 TestCase::CreateTestIsolateFromSnapshot(full_snapshot); |
| 736 Dart_EnterScope(); // Start a Dart API scope for invoking API functions. | 736 Dart_EnterScope(); // Start a Dart API scope for invoking API functions. |
| 737 | 737 |
| 738 // Load the library. | 738 // Load the library. |
| 739 Dart_Handle import_map = Dart_NewList(0); |
| 739 Dart_Handle import_lib = Dart_LoadLibrary(Dart_NewString("dart:import-lib"), | 740 Dart_Handle import_lib = Dart_LoadLibrary(Dart_NewString("dart:import-lib"), |
| 740 Dart_NewString(kLibScriptChars)); | 741 Dart_NewString(kLibScriptChars), |
| 742 import_map); |
| 741 EXPECT_VALID(import_lib); | 743 EXPECT_VALID(import_lib); |
| 742 | 744 |
| 743 // Create a test library and Load up a test script in it. | 745 // Create a test library and Load up a test script in it. |
| 744 TestCase::LoadTestScript(kScriptChars, NULL); | 746 TestCase::LoadTestScript(kScriptChars, NULL); |
| 745 | 747 |
| 746 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(), import_lib)); | 748 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(), import_lib)); |
| 747 | 749 |
| 748 // Get list of library URLs loaded and save the count. | 750 // Get list of library URLs loaded and save the count. |
| 749 Dart_Handle libs = Dart_GetLibraryURLs(); | 751 Dart_Handle libs = Dart_GetLibraryURLs(); |
| 750 EXPECT(Dart_IsList(libs)); | 752 EXPECT(Dart_IsList(libs)); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 EXPECT(Dart_ErrorHasException(result)); | 1207 EXPECT(Dart_ErrorHasException(result)); |
| 1206 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]\n", | 1208 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]\n", |
| 1207 Dart_GetError(result)); | 1209 Dart_GetError(result)); |
| 1208 | 1210 |
| 1209 Dart_ExitScope(); | 1211 Dart_ExitScope(); |
| 1210 } | 1212 } |
| 1211 | 1213 |
| 1212 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1214 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 1213 | 1215 |
| 1214 } // namespace dart | 1216 } // namespace dart |
| OLD | NEW |