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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-window-open.html

Issue 2702503002: Block renderer-initiated main frame navigations to data URLs (Closed)
Patch Set: Fix Android PDF tests where PDFs should be downloaded Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../resources/cross-frame-access.js"></script>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 testRunner.setCanOpenWindows();
9 }
10
11 var openedWindow;
12
13 function loaded() {
14 var url = "data:text/html,<html>"
15 + "<head>"
16 + "<scr" + "ipt>"
17 + "function fireSentinel() {"
18 + "window.opener.postMessage('done', '*');"
19 + "}"
20 + "</scr" + "ipt>"
21 + "</head>"
22 + "<body onload=\"fireSentinel();\">"
23 + "<p>Opened Frame</p>"
24 + "<p id='accessMe'>PASS: Cross frame access from an opener frame was denied</p>"
25 + "</body>"
26 + "</html>";
27
28 window.addEventListener('message', performTest);
29 openedWindow = window.open(url);
30 }
31
32 function performTest() {
33 try {
34 openedWindow.document.getElementById('accessMe').innerHTML = 'FA IL: Access to a window opened with a data: URL was allowed.';
35 } catch (e) {
36 }
37
38 if (window.testRunner)
39 closeWindowAndNotifyDone(openedWindow);
40 }
41 </script>
42 </head>
43 <body onload="loaded();">
44 <p>Opener Frame</p>
45 <pre id="console"></pre>
46 </body>
47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698