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

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

Issue 2693203003: Make CreationContext() not crash when there is no creation context. (Closed)
Patch Set: Rebase on top of other patch instead. 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 | « test/cctest/test-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 d03050ed675b365c7edea40ff4011a575619487d..64a0f7ae30fe5fbec4b7d1d0c57e48a40c94929d 100644
--- a/test/unittests/api/remote-object-unittest.cc
+++ b/test/unittests/api/remote-object-unittest.cc
@@ -27,6 +27,29 @@ void Constructor(const FunctionCallbackInfo<Value>& info) {
} // namespace
+TEST_F(RemoteObjectTest, CreationContextOfRemoteContext) {
+ Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate());
+ global_template->SetAccessCheckCallbackAndHandler(
+ AccessCheck, NamedPropertyHandlerConfiguration(NamedGetter),
+ IndexedPropertyHandlerConfiguration());
+
+ Local<Object> remote_context =
+ Context::NewRemoteContext(isolate(), global_template).ToLocalChecked();
+ EXPECT_TRUE(remote_context->CreationContext().IsEmpty());
+}
+
+TEST_F(RemoteObjectTest, CreationContextOfRemoteObject) {
+ Local<FunctionTemplate> constructor_template =
+ FunctionTemplate::New(isolate(), Constructor);
+ constructor_template->InstanceTemplate()->SetAccessCheckCallbackAndHandler(
+ AccessCheck, NamedPropertyHandlerConfiguration(NamedGetter),
+ IndexedPropertyHandlerConfiguration());
+
+ Local<Object> remote_object =
+ constructor_template->NewRemoteInstance().ToLocalChecked();
+ EXPECT_TRUE(remote_object->CreationContext().IsEmpty());
+}
+
TEST_F(RemoteObjectTest, RemoteContextInstanceChecks) {
Local<FunctionTemplate> parent_template =
FunctionTemplate::New(isolate(), Constructor);
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698