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

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

Issue 2715593002: Don't mark remote contexts as callable. (Closed)
Patch Set: More tests. 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
« no previous file with comments | « src/bootstrapper.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 a5b05b6aa91a4780987f51f5408166aa556356ea..1c58b418ff3f0c7e5f1eb12efc0dbf1a85430499 100644
--- a/test/unittests/api/remote-object-unittest.cc
+++ b/test/unittests/api/remote-object-unittest.cc
@@ -63,10 +63,35 @@ TEST_F(RemoteObjectTest, RemoteContextInstanceChecks) {
Local<Object> remote_context =
Context::NewRemoteContext(isolate(),
- constructor_template->InstanceTemplate())
+ constructor_template->InstanceTemplate())
.ToLocalChecked();
EXPECT_TRUE(parent_template->HasInstance(remote_context));
EXPECT_TRUE(constructor_template->HasInstance(remote_context));
}
+TEST_F(RemoteObjectTest, TypeOfRemoteContext) {
+ Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate());
+ global_template->SetAccessCheckCallbackAndHandler(
+ AccessCheck, NamedPropertyHandlerConfiguration(NamedGetter),
+ IndexedPropertyHandlerConfiguration());
+
+ Local<Object> remote_context =
+ Context::NewRemoteContext(isolate(), global_template).ToLocalChecked();
+ String::Utf8Value result(remote_context->TypeOf(isolate()));
+ EXPECT_STREQ("object", *result);
+}
+
+TEST_F(RemoteObjectTest, TypeOfRemoteObject) {
+ Local<FunctionTemplate> constructor_template =
+ FunctionTemplate::New(isolate(), Constructor);
+ constructor_template->InstanceTemplate()->SetAccessCheckCallbackAndHandler(
+ AccessCheck, NamedPropertyHandlerConfiguration(NamedGetter),
+ IndexedPropertyHandlerConfiguration());
+
+ Local<Object> remote_object =
+ constructor_template->NewRemoteInstance().ToLocalChecked();
+ String::Utf8Value result(remote_object->TypeOf(isolate()));
+ EXPECT_STREQ("object", *result);
+}
+
} // namespace v8
« no previous file with comments | « src/bootstrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698