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

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

Issue 11968011: Implement Context::GetIsolate() (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 7 years, 11 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/api.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 226d01db62955e0b76d91c14bb89b9fe245a8f30..6449594be4a5dcb4377906e9e969b78c8b061472 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -168,6 +168,23 @@ THREADED_TEST(Handles) {
}
+THREADED_TEST(IsolateOfContext) {
+ v8::HandleScope scope;
+ v8::Persistent<Context> env = Context::New();
+
+ CHECK(!env->InContext());
+ CHECK(env->GetIsolate() == v8::Isolate::GetCurrent());
+ env->Enter();
+ CHECK(env->InContext());
+ CHECK(env->GetIsolate() == v8::Isolate::GetCurrent());
+ env->Exit();
+ CHECK(!env->InContext());
+ CHECK(env->GetIsolate() == v8::Isolate::GetCurrent());
+
+ env.Dispose();
+}
+
+
THREADED_TEST(ReceiverSignature) {
v8::HandleScope scope;
LocalContext env;
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698