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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/xss-getownproperty.html

Issue 2452073002: Freeze global prototype chain per WebIDL (Closed)
Patch Set: Test improvements Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <body>
3 Test should log two "PASS" messages to the console.
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
9
10 var frame = document.body.appendChild(document.createElement("iframe"));
11 frame.src = "https://localhost:8443/security/resources/doc-with-iframe.html";
12 frame.onload = function() {
13 frame.onload = null;
14 target = frame.contentWindow;
15 target[0].location = "data:text/html,<script>name='eval'</scr" + "ipt>";
16 setTimeout(function() {
17 try {
18 Object.getOwnPropertyDescriptor(target, "eval").value("console.log(' FAIL: Access check bypassed.')");
19 } catch (e) {
20 console.log("PASS: Access check triggered");
21 }
22 target[0].location = "data:text/html,<script>name='myEval'</scr" + "ipt> ";
23 setTimeout(function() {
24 try {
25 target.myEval("console.log('FAIL: Access check bypassed.')");
26 } catch (e) {
27 console.log("PASS: Access check triggered");
28 }
29 if (window.testRunner)
30 testRunner.notifyDone();
31 }, 500);
32 }, 500);
33 }
34 </script>
35 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698