Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: runtime/vm/snapshot_test.cc

Issue 10867032: Beginning support for library prefixes in the dart API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use Dart_Null in builtin.cc Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 Dart_EnterScope(); // Start a Dart API scope for invoking API functions. 962 Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
963 963
964 // Load the library. 964 // Load the library.
965 Dart_Handle import_lib = Dart_LoadLibrary(Dart_NewString("dart:import-lib"), 965 Dart_Handle import_lib = Dart_LoadLibrary(Dart_NewString("dart:import-lib"),
966 Dart_NewString(kLibScriptChars)); 966 Dart_NewString(kLibScriptChars));
967 EXPECT_VALID(import_lib); 967 EXPECT_VALID(import_lib);
968 968
969 // Create a test library and Load up a test script in it. 969 // Create a test library and Load up a test script in it.
970 TestCase::LoadTestScript(kScriptChars, NULL); 970 TestCase::LoadTestScript(kScriptChars, NULL);
971 971
972 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(), import_lib)); 972 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(),
973 import_lib,
974 Dart_Null()));
973 975
974 // Get list of library URLs loaded and save the count. 976 // Get list of library URLs loaded and save the count.
975 Dart_Handle libs = Dart_GetLibraryURLs(); 977 Dart_Handle libs = Dart_GetLibraryURLs();
976 EXPECT(Dart_IsList(libs)); 978 EXPECT(Dart_IsList(libs));
977 Dart_ListLength(libs, &expected_num_libs); 979 Dart_ListLength(libs, &expected_num_libs);
978 980
979 // Write out the script snapshot. 981 // Write out the script snapshot.
980 result = Dart_CreateScriptSnapshot(&buffer, &size); 982 result = Dart_CreateScriptSnapshot(&buffer, &size);
981 EXPECT_VALID(result); 983 EXPECT_VALID(result);
982 script_snapshot = reinterpret_cast<uint8_t*>(malloc(size)); 984 script_snapshot = reinterpret_cast<uint8_t*>(malloc(size));
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 EXPECT(Dart_ErrorHasException(result)); 1522 EXPECT(Dart_ErrorHasException(result));
1521 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", 1523 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n",
1522 Dart_GetError(result)); 1524 Dart_GetError(result));
1523 1525
1524 Dart_ExitScope(); 1526 Dart_ExitScope();
1525 } 1527 }
1526 1528
1527 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 1529 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
1528 1530
1529 } // namespace dart 1531 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698