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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.h » ('j') | 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 "include/dart_api.h" 6 #include "include/dart_api.h"
7 #include "include/dart_mirrors_api.h" 7 #include "include/dart_mirrors_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "include/dart_tools_api.h" 9 #include "include/dart_tools_api.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 6230 matching lines...) Expand 10 before | Expand all | Expand 10 after
6241 const char* name_cstr = ""; 6241 const char* name_cstr = "";
6242 EXPECT_VALID(Dart_StringToCString(lib_name, &name_cstr)); 6242 EXPECT_VALID(Dart_StringToCString(lib_name, &name_cstr));
6243 EXPECT_STREQ("testlib", name_cstr); 6243 EXPECT_STREQ("testlib", name_cstr);
6244 6244
6245 Dart_Handle lib_uri = Dart_LibraryUrl(root_lib); 6245 Dart_Handle lib_uri = Dart_LibraryUrl(root_lib);
6246 EXPECT_VALID(lib_uri); 6246 EXPECT_VALID(lib_uri);
6247 EXPECT(!Dart_IsNull(lib_uri)); 6247 EXPECT(!Dart_IsNull(lib_uri));
6248 const char* uri_cstr = ""; 6248 const char* uri_cstr = "";
6249 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr)); 6249 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
6250 EXPECT_STREQ(TestCase::url(), uri_cstr); 6250 EXPECT_STREQ(TestCase::url(), uri_cstr);
6251
6252
6253 Dart_Handle core_uri = Dart_NewStringFromCString("dart:core");
6254 Dart_Handle core_lib = Dart_LookupLibrary(core_uri);
6255 EXPECT_VALID(core_lib);
6256 EXPECT(Dart_IsLibrary(core_lib));
6257
6258 Dart_Handle result = Dart_SetRootLibrary(core_uri); // Not a library.
6259 EXPECT(Dart_IsError(result));
6260 root_lib = Dart_RootLibrary();
6261 lib_uri = Dart_LibraryUrl(root_lib);
6262 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
6263 EXPECT_STREQ(TestCase::url(), uri_cstr); // Root library didn't change.
6264
6265 result = Dart_SetRootLibrary(core_lib);
6266 EXPECT_VALID(result);
6267 root_lib = Dart_RootLibrary();
6268 lib_uri = Dart_LibraryUrl(root_lib);
6269 EXPECT_VALID(Dart_StringToCString(lib_uri, &uri_cstr));
6270 EXPECT_STREQ("dart:core", uri_cstr); // Root library did change.
6251 } 6271 }
6252 6272
6253 6273
6254 static int index = 0; 6274 static int index = 0;
6255 6275
6256 6276
6257 static Dart_Handle import_library_handler(Dart_LibraryTag tag, 6277 static Dart_Handle import_library_handler(Dart_LibraryTag tag,
6258 Dart_Handle library, 6278 Dart_Handle library,
6259 Dart_Handle url) { 6279 Dart_Handle url) {
6260 if (tag == Dart_kCanonicalizeUrl) { 6280 if (tag == Dart_kCanonicalizeUrl) {
(...skipping 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after
9823 9843
9824 // Heartbeat test for new events. 9844 // Heartbeat test for new events.
9825 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); 9845 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer);
9826 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); 9846 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer);
9827 9847
9828 // Free buffer allocated by AppendStreamConsumer 9848 // Free buffer allocated by AppendStreamConsumer
9829 free(data.buffer); 9849 free(data.buffer);
9830 } 9850 }
9831 9851
9832 } // namespace dart 9852 } // namespace dart
OLDNEW
« 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