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

Unified Diff: vm/unit_test.cc

Issue 8537023: Implement automatic loading of dart:core_native_fields library (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« vm/object.cc ('K') | « vm/object_store.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/unit_test.cc
===================================================================
--- vm/unit_test.cc (revision 1465)
+++ vm/unit_test.cc (working copy)
@@ -48,11 +48,21 @@
}
+static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
+ Dart_Handle library,
+ Dart_Handle url) {
+ if (tag == kCanonicalizeUrl) {
+ return url;
+ }
+ return Dart_LookupLibrary(url);
+}
+
+
Dart_Handle TestCase::LoadTestScript(const char* script,
Dart_NativeEntryResolver resolver) {
Dart_Handle url = Dart_NewString(TestCase::url());
Dart_Handle source = Dart_NewString(script);
- Dart_Handle lib = Dart_LoadScript(url, source, NULL);
+ Dart_Handle lib = Dart_LoadScript(url, source, LibraryTagHandler);
ASSERT(Dart_IsValid(lib));
Dart_Handle result = Dart_SetNativeResolver(lib, resolver);
ASSERT(Dart_IsValid(result));
« vm/object.cc ('K') | « vm/object_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698