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

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

Issue 1431473003: Mark GetCallingContext as soon-to-be deprecated (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/test-accessors.cc ('k') | test/cctest/test-debug.cc » ('j') | 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 0a5c28c7be0ba6530b2056f49632af7dc1b2fd71..0aa857ce63dd6f96ae68d958621f9acdc9ded016 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -13559,24 +13559,6 @@ TEST(DefineOwnProperty) {
}
-static v8::Local<Context> calling_context0;
-static v8::Local<Context> calling_context1;
-static v8::Local<Context> calling_context2;
-
-
-// Check that the call to the callback is initiated in
-// calling_context2, the directly calling context is calling_context1
-// and the callback itself is in calling_context0.
-static void GetCallingContextCallback(
- const v8::FunctionCallbackInfo<v8::Value>& args) {
- ApiTestFuzzer::Fuzz();
- CHECK(args.GetIsolate()->GetCurrentContext() == calling_context0);
- CHECK(args.GetIsolate()->GetCallingContext() == calling_context1);
- CHECK(args.GetIsolate()->GetEnteredContext() == calling_context2);
- args.GetReturnValue().Set(42);
-}
-
-
THREADED_TEST(GetCurrentContextWhenNotInContext) {
i::Isolate* isolate = CcTest::i_isolate();
CHECK(isolate != NULL);
@@ -13589,52 +13571,6 @@ THREADED_TEST(GetCurrentContextWhenNotInContext) {
}
-THREADED_TEST(GetCallingContext) {
- v8::Isolate* isolate = CcTest::isolate();
- v8::HandleScope scope(isolate);
-
- Local<Context> calling_context0(Context::New(isolate));
- Local<Context> calling_context1(Context::New(isolate));
- Local<Context> calling_context2(Context::New(isolate));
- ::calling_context0 = calling_context0;
- ::calling_context1 = calling_context1;
- ::calling_context2 = calling_context2;
-
- // Allow cross-domain access.
- Local<String> token = v8_str("<security token>");
- calling_context0->SetSecurityToken(token);
- calling_context1->SetSecurityToken(token);
- calling_context2->SetSecurityToken(token);
-
- // Create an object with a C++ callback in context0.
- calling_context0->Enter();
- Local<v8::FunctionTemplate> callback_templ =
- v8::FunctionTemplate::New(isolate, GetCallingContextCallback);
- calling_context0->Global()->Set(v8_str("callback"),
- callback_templ->GetFunction());
- calling_context0->Exit();
-
- // Expose context0 in context1 and set up a function that calls the
- // callback function.
- calling_context1->Enter();
- calling_context1->Global()->Set(v8_str("context0"),
- calling_context0->Global());
- CompileRun("function f() { context0.callback() }");
- calling_context1->Exit();
-
- // Expose context1 in context2 and call the callback function in
- // context0 indirectly through f in context1.
- calling_context2->Enter();
- calling_context2->Global()->Set(v8_str("context1"),
- calling_context1->Global());
- CompileRun("context1.f()");
- calling_context2->Exit();
- ::calling_context0.Clear();
- ::calling_context1.Clear();
- ::calling_context2.Clear();
-}
-
-
// Check that a variable declaration with no explicit initialization
// value does shadow an existing property in the prototype chain.
THREADED_TEST(InitGlobalVarInProtoChain) {
« no previous file with comments | « test/cctest/test-accessors.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698