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

Side by Side Diff: LayoutTests/http/tests/security/contentSecurityPolicy/object-src-param-blocked.html

Issue 76303002: CSP: Check <param> element values against the document's CSP before loading. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Event. Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
9 </script>
10 <meta http-equiv="Content-Security-Policy" content="object-src http://localhost: 8080">
11 </head>
12 <body>
13 This test passes if there is are four console messages saying the plugins were b locked.
14 <script>
15 var names = ['src', 'movie', 'code', 'url'];
Tom Sepez 2013/11/19 17:54:22 nit: maybe a link to the section of the spec that
Mike West 2013/11/19 18:35:06 This is non-standard behavior, based (I think) on
16
17 var errorsSeen = 0;
18 for (var i = 0; i < names.length; i++) {
19 var o = document.createElement('object');
20 o.setAttribute('type', 'application/x-webkit-test-netscape');
21 o.addEventListener('error', function () {
22 console.log('PASS: Error occurred, so load was correctly blocked.');
23 errorsSeen++;
24 if (errorsSeen === names.length && window.testRunner)
25 testRunner.notifyDone();
26 });
27
Tom Sepez 2013/11/19 17:54:22 Can we also use an onload handler to keep track of
Mike West 2013/11/19 18:35:06 Sure. It's probably worth rewriting all the object
28 var p = document.createElement('param');
29 p.setAttribute('value', 'http://127.0.0.1:8080/plugins/resources/mock-pl ugin.pl?' + names[i]);
30 p.setAttribute('name', names[i]);
31
32 o.appendChild(p);
33
34 document.body.appendChild(o);
35 }
36 </script>
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698