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_message.h" | 10 #include "vm/dart_api_message.h" |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 Dart_ExitScope(); | 968 Dart_ExitScope(); |
969 } | 969 } |
970 | 970 |
971 { | 971 { |
972 // Create an Isolate using the full snapshot, load a script and create | 972 // Create an Isolate using the full snapshot, load a script and create |
973 // a script snapshot of the script. | 973 // a script snapshot of the script. |
974 TestCase::CreateTestIsolateFromSnapshot(full_snapshot); | 974 TestCase::CreateTestIsolateFromSnapshot(full_snapshot); |
975 Dart_EnterScope(); // Start a Dart API scope for invoking API functions. | 975 Dart_EnterScope(); // Start a Dart API scope for invoking API functions. |
976 | 976 |
977 // Load the library. | 977 // Load the library. |
978 Dart_Handle import_map = Dart_NewList(0); | |
979 Dart_Handle import_lib = Dart_LoadLibrary(Dart_NewString("dart:import-lib"), | 978 Dart_Handle import_lib = Dart_LoadLibrary(Dart_NewString("dart:import-lib"), |
980 Dart_NewString(kLibScriptChars), | 979 Dart_NewString(kLibScriptChars)); |
981 import_map); | |
982 EXPECT_VALID(import_lib); | 980 EXPECT_VALID(import_lib); |
983 | 981 |
984 // Create a test library and Load up a test script in it. | 982 // Create a test library and Load up a test script in it. |
985 TestCase::LoadTestScript(kScriptChars, NULL); | 983 TestCase::LoadTestScript(kScriptChars, NULL); |
986 | 984 |
987 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(), import_lib)); | 985 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(), import_lib)); |
988 | 986 |
989 // Get list of library URLs loaded and save the count. | 987 // Get list of library URLs loaded and save the count. |
990 Dart_Handle libs = Dart_GetLibraryURLs(); | 988 Dart_Handle libs = Dart_GetLibraryURLs(); |
991 EXPECT(Dart_IsList(libs)); | 989 EXPECT(Dart_IsList(libs)); |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1540 EXPECT(Dart_ErrorHasException(result)); | 1538 EXPECT(Dart_ErrorHasException(result)); |
1541 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1539 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
1542 Dart_GetError(result)); | 1540 Dart_GetError(result)); |
1543 | 1541 |
1544 Dart_ExitScope(); | 1542 Dart_ExitScope(); |
1545 } | 1543 } |
1546 | 1544 |
1547 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1545 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
1548 | 1546 |
1549 } // namespace dart | 1547 } // namespace dart |
OLD | NEW |