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

Unified Diff: test/unittests/api/remote-object-unittest.cc

Issue 2698683003: Make FunctionTemplate::HasInstance checks work with remote contexts. (Closed)
Patch Set: Fix format. Created 3 years, 10 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
« src/api.cc ('K') | « 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/unittests/api/remote-object-unittest.cc
diff --git a/test/unittests/api/remote-object-unittest.cc b/test/unittests/api/remote-object-unittest.cc
index dc45d086ab86989221fff922e2f9885749387f78..7cc1f9be9b0685cc168cdf8cd2ddd8745953912b 100644
--- a/test/unittests/api/remote-object-unittest.cc
+++ b/test/unittests/api/remote-object-unittest.cc
@@ -59,4 +59,18 @@ TEST_F(RemoteObjectTest, CreationContextOfRemoteObject) {
EXPECT_TRUE(remote_object->CreationContext().IsEmpty());
}
+TEST_F(RemoteObjectTest, RemoteContextHasInstance) {
+ v8::Local<v8::FunctionTemplate> constructor_template =
+ v8::FunctionTemplate::New(isolate(), Constructor);
+ constructor_template->InstanceTemplate()->SetAccessCheckCallbackAndHandler(
+ AccessCheck, v8::NamedPropertyHandlerConfiguration(NamedGetter),
+ v8::IndexedPropertyHandlerConfiguration());
+
+ v8::Local<v8::Object> remote_context =
+ v8::Context::NewRemoteContext(isolate(),
+ constructor_template->InstanceTemplate())
+ .ToLocalChecked();
+ EXPECT_TRUE(constructor_template->HasInstance(remote_context));
+}
+
} // namespace v8
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698