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

Unified Diff: vm/unit_test.h

Issue 8673002: - Refactor the isolate callback mechanism to also include creation of the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/thread_win.cc ('k') | vm/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/unit_test.h
===================================================================
--- vm/unit_test.h (revision 1955)
+++ vm/unit_test.h (working copy)
@@ -162,10 +162,30 @@
Dart_NativeEntryResolver resolver);
static Dart_Handle lib();
static const char* url() { return "dart:test-lib"; }
+ static Dart_Isolate CreateTestIsolateFromSnapshot(uint8_t* buffer) {
+ return CreateIsolate(buffer);
+ }
+ static Dart_Isolate CreateTestIsolate() {
+ return CreateIsolate(NULL);
+ }
+ static Dart_Handle library_handler(Dart_LibraryTag tag,
+ Dart_Handle library,
+ Dart_Handle url);
virtual void Run();
private:
+ static Dart_Isolate CreateIsolate(uint8_t* buffer) {
+ char* err;
+ Dart_Isolate isolate = Dart_CreateIsolate(buffer, NULL, &err);
+ if (isolate == NULL) {
+ OS::Print("Creation of isolate failed '%s'\n", err);
+ free(err);
+ }
+ EXPECT(isolate != NULL);
+ return isolate;
+ }
+
RunEntry* const run_;
};
@@ -173,8 +193,7 @@
class TestIsolateScope {
public:
TestIsolateScope() {
- isolate_ = reinterpret_cast<Isolate*>(Dart_CreateIsolate(NULL, NULL));
- EXPECT(isolate_ != NULL);
+ isolate_ = reinterpret_cast<Isolate*>(TestCase::CreateTestIsolate());
Dart_EnterScope(); // Create a Dart API scope for unit tests.
}
~TestIsolateScope() {
« no previous file with comments | « vm/thread_win.cc ('k') | vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698