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

Unified Diff: LayoutTests/http/tests/security/xss-getownproperty.html

Issue 921683002: make window interceptors DoNoCheckSecurity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 5 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
Index: LayoutTests/http/tests/security/xss-getownproperty.html
diff --git a/LayoutTests/http/tests/security/xss-getownproperty.html b/LayoutTests/http/tests/security/xss-getownproperty.html
new file mode 100644
index 0000000000000000000000000000000000000000..9e6645db800226e7c0ac04641d591fd9e4674b82
--- /dev/null
+++ b/LayoutTests/http/tests/security/xss-getownproperty.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<body>
+Test should log two "PASS" messages to the console.
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+var frame = document.body.appendChild(document.createElement("iframe"));
+frame.src = "https://localhost:8443/security/resources/doc-with-iframe.html";
+frame.onload = function() {
+ frame.onload = null;
+ target = frame.contentWindow;
+ target[0].location = "data:text/html,<script>name='eval'</scr" + "ipt>";
+ setTimeout(function() {
+ try {
+ Object.getOwnPropertyDescriptor(target, "eval").value("console.log('FAIL: Access check bypassed.')");
+ } catch (e) {
+ console.log("PASS: Access check triggered");
+ }
+ target[0].location = "data:text/html,<script>name='myEval'</scr" + "ipt>";
+ setTimeout(function() {
+ try {
+ target.myEval("console.log('FAIL: Access check bypassed.')");
+ } catch (e) {
+ console.log("PASS: Access check triggered");
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 500);
+ }, 500);
+}
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698