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

Unified Diff: test/cctest/test-api.cc

Issue 23453030: Remove obsolete global V8::has_been_fooed flags. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « src/v8.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 4468e6599ba0dc179b8ff6bdd19142c64254368a..4bd17270f97babd1efa671e338fda03bea61acb1 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -163,6 +163,24 @@ static void SignatureCallback(
}
+// Tests that call v8::V8::Dispose() cannot be threaded.
+TEST(InitializeAndDisposeOnce) {
+ CHECK(v8::V8::Initialize());
+ CHECK(v8::V8::Dispose());
+}
+
+
+// Tests that call v8::V8::Dispose() cannot be threaded.
+TEST(InitializeAndDisposeMultiple) {
+ for (int i = 0; i < 3; ++i) CHECK(v8::V8::Dispose());
+ for (int i = 0; i < 3; ++i) CHECK(v8::V8::Initialize());
+ for (int i = 0; i < 3; ++i) CHECK(v8::V8::Dispose());
+ // TODO(mstarzinger): This should fail gracefully instead of asserting.
+ // for (int i = 0; i < 3; ++i) CHECK(v8::V8::Initialize());
Michael Starzinger 2013/09/04 13:24:29 Note that this check has been asserting before thi
+ for (int i = 0; i < 3; ++i) CHECK(v8::V8::Dispose());
+}
+
+
THREADED_TEST(Handles) {
v8::HandleScope scope(v8::Isolate::GetCurrent());
Local<Context> local_env;
« no previous file with comments | « src/v8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698