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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 1418833004: VM: Service isolate under precompilation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index b11ffb418aa2848a95ddd4cb5e1bf39eadcd42e7..3f5056ff709af82abc7f473e7441c972ea983813 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -6248,6 +6248,26 @@ TEST_CASE(RootLibrary) {
const char* uri_cstr = "";
EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
EXPECT_STREQ(TestCase::url(), uri_cstr);
+
+
+ Dart_Handle core_uri = Dart_NewStringFromCString("dart:core");
+ Dart_Handle core_lib = Dart_LookupLibrary(core_uri);
+ EXPECT_VALID(core_lib);
+ EXPECT(Dart_IsLibrary(core_lib));
+
+ Dart_Handle result = Dart_SetRootLibrary(core_uri); // Not a library.
+ EXPECT(Dart_IsError(result));
+ root_lib = Dart_RootLibrary();
+ lib_uri = Dart_LibraryUrl(root_lib);
+ EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
+ EXPECT_STREQ(TestCase::url(), uri_cstr); // Root library didn't change.
+
+ result = Dart_SetRootLibrary(core_lib);
+ EXPECT_VALID(result);
+ root_lib = Dart_RootLibrary();
+ lib_uri = Dart_LibraryUrl(root_lib);
+ EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
+ EXPECT_STREQ("dart:core", uri_cstr); // Root library did change.
}
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698