| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |