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

Side by Side Diff: LayoutTests/http/tests/security/contentSecurityPolicy/connect-src-beacon-blocked.html

Issue 232053005: Implement navigator.sendBeacon() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Revert CSP checking on redirects Created 6 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta http-equiv="Content-Security-Policy" content="connect-src http://localhost :8000"> 4 <meta http-equiv="Content-Security-Policy" content="connect-src http://localhost :8000">
5 <script> 5 <script>
6 if (window.testRunner) 6 if (window.testRunner)
7 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
8 </script> 8 </script>
9 </head> 9 </head>
10 <body> 10 <body>
11 <pre id="console"></pre> 11 <pre id="console"></pre>
12 <script> 12 <script>
13 function log(msg) 13 function log(msg)
14 { 14 {
15 document.getElementById("console").appendChild(document.createTextNode(msg + "\n")); 15 document.getElementById("console").appendChild(document.createTextNode(msg + "\n"));
16 } 16 }
17 17
18 try { 18 try {
19 var es = new EventSource("http://127.0.0.1:8000/eventsource/resources/simple -event-stream.asis"); 19 var es = navigator.sendBeacon("http://127.0.0.1:8000/security/contentSecurit yPolicy/echo-report.php");
20 log("Fail"); 20 log("Fail");
21 } catch(e) { 21 } catch(e) {
22 log("Pass"); 22 log("Pass");
23 } 23 }
24
25 </script> 24 </script>
26 </body> 25 </body>
27 </html> 26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698