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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/view-source-navigation-block.html

Issue 1917073002: Block webpages from navigating to view-source URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add layout and browser tests Created 4 years, 6 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 lang="en">
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4 <title>view-source navigation should be blocked</title>
5 </head>
6 <script>
7 window.onunload = function() {
8 console.error('FAIL');
9 testRunner.notifyDone();
Nate Chapin 2016/05/27 23:57:32 Nit: if (window.testRunner)
10 }
11 function test() {
12 window.location = "view-source:about:blank";
13 setTimeout(function() {
14 if (window.testRunner) {
15 document.getElementById("result").innerHTML = "PASS";
16 testRunner.notifyDone();
17 }
18 }, 1000);
meacer 2016/05/23 23:57:47 This is ugly as it uses setTimeout with a non-zero
Charlie Reis 2016/05/24 22:54:17 Yeah, we shouldn't do this. Maybe there's an erro
Nate Chapin 2016/05/27 23:57:32 This is a bit tougher because it's view-source. No
meacer 2016/05/31 23:57:54 Looks like queueLoad triggers a browser initiated
Charlie Reis 2016/06/01 22:59:51 Do we actually need a layout test for this? You'v
19 }
20 if (window.testRunner) {
21 testRunner.dumpAsText();
22 testRunner.waitUntilDone();
23 }
24 document.addEventListener('DOMContentLoaded', test, false);
25 </script>
26 <div id="result"></div>
27 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698