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

Unified Diff: runtime/vm/unit_test.h

Issue 15736011: Create test isolates using a snapshot, this ensures that we do not depend (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.h
===================================================================
--- runtime/vm/unit_test.h (revision 23022)
+++ runtime/vm/unit_test.h (working copy)
@@ -188,6 +188,13 @@
class VirtualMemory;
+// snapshot_buffer points to a snapshot if we link in a snapshot otherwise
+// it is initialized to NULL.
+namespace bin {
+extern const uint8_t* snapshot_buffer;
+}
+
+
class TestCaseBase {
public:
explicit TestCaseBase(const char* name);
@@ -225,7 +232,7 @@
return CreateIsolate(buffer);
}
static Dart_Isolate CreateTestIsolate() {
- return CreateIsolate(NULL);
+ return CreateIsolate(bin::snapshot_buffer);
}
static Dart_Handle library_handler(Dart_LibraryTag tag,
Dart_Handle library,
@@ -234,7 +241,7 @@
virtual void Run();
private:
- static Dart_Isolate CreateIsolate(uint8_t* buffer) {
+ static Dart_Isolate CreateIsolate(const uint8_t* buffer) {
char* err;
Dart_Isolate isolate = Dart_CreateIsolate(NULL, NULL, buffer, NULL, &err);
if (isolate == NULL) {
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698