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

Unified Diff: test/cctest/test-object-observe.cc

Issue 1352023002: Version 4.5.103.34 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5
Patch Set: Created 5 years, 3 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/runtime/runtime-object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-object-observe.cc
diff --git a/test/cctest/test-object-observe.cc b/test/cctest/test-object-observe.cc
index abbf2b7a6c00496156bf0e4ab27efb78eae4af53..0295de5e233caef72bfad1cdc283f52c78437c58 100644
--- a/test/cctest/test-object-observe.cc
+++ b/test/cctest/test-object-observe.cc
@@ -885,3 +885,39 @@ TEST(UseCountObjectGetNotifier) {
CompileRun("Object.getNotifier(obj)");
CHECK_EQ(1, use_counts[v8::Isolate::kObjectObserve]);
}
+
+
+static bool NamedAccessCheckAlwaysAllow(Local<v8::Object> global,
+ Local<v8::Value> name,
+ v8::AccessType type,
+ Local<Value> data) {
+ return true;
+}
+
+
+TEST(DisallowObserveAccessCheckedObject) {
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope scope(isolate);
+ LocalContext env;
+ v8::Local<v8::ObjectTemplate> object_template =
+ v8::ObjectTemplate::New(isolate);
+ object_template->SetAccessCheckCallbacks(NamedAccessCheckAlwaysAllow, NULL);
+ env->Global()->Set(v8_str("obj"), object_template->NewInstance());
+ v8::TryCatch try_catch(isolate);
+ CompileRun("Object.observe(obj, function(){})");
+ CHECK(try_catch.HasCaught());
+}
+
+
+TEST(DisallowGetNotifierAccessCheckedObject) {
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope scope(isolate);
+ LocalContext env;
+ v8::Local<v8::ObjectTemplate> object_template =
+ v8::ObjectTemplate::New(isolate);
+ object_template->SetAccessCheckCallbacks(NamedAccessCheckAlwaysAllow, NULL);
+ env->Global()->Set(v8_str("obj"), object_template->NewInstance());
+ v8::TryCatch try_catch(isolate);
+ CompileRun("Object.getNotifier(obj)");
+ CHECK(try_catch.HasCaught());
+}
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698