Chromium Code Reviews| 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; |