Index: test/cctest/cctest.cc |
diff --git a/test/cctest/cctest.cc b/test/cctest/cctest.cc |
index f1737602eafdb1d942421bad66cd2e0c6e2616f6..deed91aa57b54e5f3ba5a54acc559daf6ed1e3c1 100644 |
--- a/test/cctest/cctest.cc |
+++ b/test/cctest/cctest.cc |
@@ -57,6 +57,24 @@ CcTest::CcTest(TestFunction* callback, const char* file, const char* name, |
} |
+v8::Persistent<v8::Context> CcTest::context_; |
+ |
+ |
+void CcTest::InitializeVM(CcTestExtensionFlags extensions) { |
+ const char* extension_names[kMaxExtensions]; |
+ int extension_count = 0; |
+#define CHECK_EXTENSION_FLAG(Name, Id) \ |
+ if (extensions.Contains(Name##_ID)) extension_names[extension_count++] = Id; |
+ EXTENSION_LIST(CHECK_EXTENSION_FLAG) |
+#undef CHECK_EXTENSION_FLAG |
+ if (context_.IsEmpty()) { |
+ v8::ExtensionConfiguration config(extension_count, extension_names); |
+ context_ = v8::Context::New(&config); |
+ } |
+ context_->Enter(); |
+} |
+ |
+ |
static void PrintTestList(CcTest* current) { |
if (current == NULL) return; |
PrintTestList(current->prev()); |
@@ -71,6 +89,7 @@ static void PrintTestList(CcTest* current) { |
v8::Isolate* CcTest::default_isolate_; |
+ |
int main(int argc, char* argv[]) { |
v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true); |
CcTest::set_default_isolate(v8::Isolate::GetCurrent()); |