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

Unified Diff: test/cctest/cctest.cc

Issue 23929006: remove remaining uses of default isolate in tests (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix serializer tests Created 7 years, 3 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 | « test/cctest/cctest.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.cc
diff --git a/test/cctest/cctest.cc b/test/cctest/cctest.cc
index 962dc02e2f6d29358caf2e8bd47a9b7d54e01a6c..4aa9c7eb7126382ddc5da1e460a582ccd2e63c1f 100644
--- a/test/cctest/cctest.cc
+++ b/test/cctest/cctest.cc
@@ -31,6 +31,7 @@
enum InitializationState {kUnset, kUnintialized, kInitialized};
static InitializationState initialization_state_ = kUnset;
+static bool disable_automatic_dispose_ = false;
CcTest* CcTest::last_ = NULL;
bool CcTest::initialize_called_ = false;
@@ -66,14 +67,10 @@ void CcTest::Run() {
if (!initialize_) {
CHECK(initialization_state_ != kInitialized);
initialization_state_ = kUnintialized;
- // TODO(dcarney): Remove this when default isolate is gone.
- if (isolate_ == NULL) {
- isolate_ = v8::Isolate::GetCurrent();
- }
+ CHECK(CcTest::isolate_ == NULL);
} else {
CHECK(initialization_state_ != kUnintialized);
initialization_state_ = kInitialized;
- i::Isolate::SetCrashIfDefaultIsolateInitialized();
if (isolate_ == NULL) {
isolate_ = v8::Isolate::New();
}
@@ -101,6 +98,12 @@ v8::Local<v8::Context> CcTest::NewContext(CcTestExtensionFlags extensions,
}
+void CcTest::DisableAutomaticDispose() {
+ CHECK_EQ(kUnintialized, initialization_state_);
+ disable_automatic_dispose_ = true;
+}
+
+
static void PrintTestList(CcTest* current) {
if (current == NULL) return;
PrintTestList(current->prev());
@@ -131,6 +134,7 @@ static void SuggestTestHarness(int tests) {
int main(int argc, char* argv[]) {
v8::V8::InitializeICU();
+ i::Isolate::SetCrashIfDefaultIsolateInitialized();
v8::internal::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
@@ -184,7 +188,7 @@ int main(int argc, char* argv[]) {
}
if (print_run_count && tests_run != 1)
printf("Ran %i tests.\n", tests_run);
- v8::V8::Dispose();
+ if (!disable_automatic_dispose_) v8::V8::Dispose();
return 0;
}
« no previous file with comments | « test/cctest/cctest.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698