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..4830ee53e5eb261429e8e8784f523516b56d2bd9 100644 |
--- a/test/unittests/api/remote-object-unittest.cc |
+++ b/test/unittests/api/remote-object-unittest.cc |
@@ -59,4 +59,23 @@ TEST_F(RemoteObjectTest, CreationContextOfRemoteObject) { |
EXPECT_TRUE(remote_object->CreationContext().IsEmpty()); |
} |
+TEST_F(RemoteObjectTest, RemoteContextHasInstance) { |
+ v8::Local<v8::FunctionTemplate> parent_template = |
+ v8::FunctionTemplate::New(isolate(), Constructor); |
+ |
+ v8::Local<v8::FunctionTemplate> constructor_template = |
+ v8::FunctionTemplate::New(isolate(), Constructor); |
+ constructor_template->InstanceTemplate()->SetAccessCheckCallbackAndHandler( |
+ AccessCheck, v8::NamedPropertyHandlerConfiguration(NamedGetter), |
+ v8::IndexedPropertyHandlerConfiguration()); |
+ constructor_template->Inherit(parent_template); |
+ |
+ v8::Local<v8::Object> remote_context = |
+ v8::Context::NewRemoteContext(isolate(), |
+ constructor_template->InstanceTemplate()) |
+ .ToLocalChecked(); |
+ EXPECT_TRUE(parent_template->HasInstance(remote_context)); |
+ EXPECT_TRUE(constructor_template->HasInstance(remote_context)); |
+} |
+ |
} // namespace v8 |