Index: runtime/vm/unit_test.cc |
=================================================================== |
--- runtime/vm/unit_test.cc (revision 35981) |
+++ runtime/vm/unit_test.cc (working copy) |
@@ -81,7 +81,12 @@ |
Dart_Handle builtin_lib = |
Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary); |
DART_CHECK_VALID(builtin_lib); |
- return DartUtils::CanonicalizeURL(NULL, library, url_chars); |
+ |
+ Dart_Handle library_url = Dart_LibraryUrl(library); |
+ if (Dart_IsError(library_url)) { |
+ return library_url; |
+ } |
+ return DartUtils::ResolveUri(library_url, url, builtin_lib); |
} |
if (is_dart_scheme_url) { |
ASSERT(tag == Dart_kImportTag); |
@@ -101,17 +106,14 @@ |
Builtin::PartSource(Builtin::kIOLibrary, |
url_chars)); |
} |
- return DartUtils::LoadSource(NULL, |
- library, |
- url, |
- tag, |
- url_chars); |
+ return DartUtils::LoadSource(library, url, tag, url_chars); |
} |
Dart_Handle TestCase::LoadTestScript(const char* script, |
- Dart_NativeEntryResolver resolver) { |
- Dart_Handle url = NewString(TestCase::url()); |
+ Dart_NativeEntryResolver resolver, |
+ const char* lib_url) { |
+ Dart_Handle url = NewString(lib_url); |
Dart_Handle source = NewString(script); |
Dart_Handle result = Dart_SetLibraryTagHandler(LibraryTagHandler); |
EXPECT_VALID(result); |
@@ -124,6 +126,12 @@ |
} |
+Dart_Handle TestCase::LoadCoreTestScript(const char* script, |
+ Dart_NativeEntryResolver resolver) { |
+ return LoadTestScript(script, resolver, CORELIB_TEST_URI); |
+} |
+ |
+ |
Dart_Handle TestCase::lib() { |
Dart_Handle url = NewString(TestCase::url()); |
Dart_Handle lib = Dart_LookupLibrary(url); |