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

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

Issue 2093813002: Allow null in Dart_SetRootLibrary. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « runtime/vm/dart_api_impl.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 "bin/builtin.h" 5 #include "bin/builtin.h"
6 #include "vm/compiler.h" 6 #include "vm/compiler.h"
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_mirrors_api.h" 8 #include "include/dart_mirrors_api.h"
9 #include "include/dart_native_api.h" 9 #include "include/dart_native_api.h"
10 #include "include/dart_tools_api.h" 10 #include "include/dart_tools_api.h"
(...skipping 5968 matching lines...) Expand 10 before | Expand all | Expand 10 after
5979 lib_uri = Dart_LibraryUrl(root_lib); 5979 lib_uri = Dart_LibraryUrl(root_lib);
5980 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr)); 5980 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
5981 EXPECT_STREQ(TestCase::url(), uri_cstr); // Root library didn't change. 5981 EXPECT_STREQ(TestCase::url(), uri_cstr); // Root library didn't change.
5982 5982
5983 result = Dart_SetRootLibrary(core_lib); 5983 result = Dart_SetRootLibrary(core_lib);
5984 EXPECT_VALID(result); 5984 EXPECT_VALID(result);
5985 root_lib = Dart_RootLibrary(); 5985 root_lib = Dart_RootLibrary();
5986 lib_uri = Dart_LibraryUrl(root_lib); 5986 lib_uri = Dart_LibraryUrl(root_lib);
5987 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr)); 5987 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
5988 EXPECT_STREQ("dart:core", uri_cstr); // Root library did change. 5988 EXPECT_STREQ("dart:core", uri_cstr); // Root library did change.
5989
5990 result = Dart_SetRootLibrary(Dart_Null());
5991 EXPECT_VALID(result);
5992 root_lib = Dart_RootLibrary();
5993 EXPECT(Dart_IsNull(root_lib)); // Root library did change.
5989 } 5994 }
5990 5995
5991 5996
5992 static int index = 0; 5997 static int index = 0;
5993 5998
5994 5999
5995 static Dart_Handle import_library_handler(Dart_LibraryTag tag, 6000 static Dart_Handle import_library_handler(Dart_LibraryTag tag,
5996 Dart_Handle library, 6001 Dart_Handle library,
5997 Dart_Handle url) { 6002 Dart_Handle url) {
5998 if (tag == Dart_kCanonicalizeUrl) { 6003 if (tag == Dart_kCanonicalizeUrl) {
(...skipping 4155 matching lines...) Expand 10 before | Expand all | Expand 10 after
10154 result = Dart_Invoke(lib, 10159 result = Dart_Invoke(lib,
10155 NewString("foozoo"), 10160 NewString("foozoo"),
10156 0, 10161 0,
10157 NULL); 10162 NULL);
10158 EXPECT(Dart_IsError(result)); 10163 EXPECT(Dart_IsError(result));
10159 } 10164 }
10160 10165
10161 #endif // !PRODUCT 10166 #endif // !PRODUCT
10162 10167
10163 } // namespace dart 10168 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698