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

Side by Side Diff: runtime/vm/unit_test.h

Issue 1663963002: - reorganize DartUtils::PrepareForScriptLoading so that it does not have the wait for service load … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 4 years, 10 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/benchmark_test.cc ('k') | runtime/vm/unit_test.cc » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef VM_UNIT_TEST_H_ 5 #ifndef VM_UNIT_TEST_H_
6 #define VM_UNIT_TEST_H_ 6 #define VM_UNIT_TEST_H_
7 7
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 9
10 #include "platform/globals.h" 10 #include "platform/globals.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 return CreateIsolate(bin::isolate_snapshot_buffer, name); 299 return CreateIsolate(bin::isolate_snapshot_buffer, name);
300 } 300 }
301 static Dart_Handle library_handler(Dart_LibraryTag tag, 301 static Dart_Handle library_handler(Dart_LibraryTag tag,
302 Dart_Handle library, 302 Dart_Handle library,
303 Dart_Handle url); 303 Dart_Handle url);
304 static char* BigintToHexValue(Dart_CObject* bigint); 304 static char* BigintToHexValue(Dart_CObject* bigint);
305 305
306 virtual void Run(); 306 virtual void Run();
307 307
308 private: 308 private:
309 static Dart_Isolate CreateIsolate(const uint8_t* buffer, 309 static Dart_Isolate CreateIsolate(const uint8_t* buffer, const char* name);
310 const char* name) {
311 char* err;
312 Dart_Isolate isolate = Dart_CreateIsolate(
313 name, NULL, buffer, NULL, NULL, &err);
314 if (isolate == NULL) {
315 OS::Print("Creation of isolate failed '%s'\n", err);
316 free(err);
317 }
318 EXPECT(isolate != NULL);
319 return isolate;
320 }
321 310
322 RunEntry* const run_; 311 RunEntry* const run_;
323 }; 312 };
324 313
325 314
326 class TestIsolateScope { 315 class TestIsolateScope {
327 public: 316 public:
328 TestIsolateScope() { 317 TestIsolateScope() {
329 isolate_ = reinterpret_cast<Isolate*>(TestCase::CreateTestIsolate()); 318 isolate_ = reinterpret_cast<Isolate*>(TestCase::CreateTestIsolate());
330 Dart_EnterScope(); // Create a Dart API scope for unit tests. 319 Dart_EnterScope(); // Create a Dart API scope for unit tests.
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 // Yields: 559 // Yields:
571 // 560 //
572 // out = "\"id\":\"\"" 561 // out = "\"id\":\"\""
573 // 562 //
574 void ElideJSONSubstring(const char* prefix, const char* in, char* out); 563 void ElideJSONSubstring(const char* prefix, const char* in, char* out);
575 564
576 565
577 } // namespace dart 566 } // namespace dart
578 567
579 #endif // VM_UNIT_TEST_H_ 568 #endif // VM_UNIT_TEST_H_
OLDNEW
« no previous file with comments | « runtime/vm/benchmark_test.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698