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

Side by Side Diff: LayoutTests/http/tests/security/contentSecurityPolicy/resources/object-src-param.js

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: Async. Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 if (window.testRunner) {
2 testRunner.dumpAsText();
3 testRunner.waitUntilDone();
4 }
5
6 function appendObjectElement(type) {
7 window.onload = function () {
8 var o = document.createElement('object');
9 o.setAttribute('type', 'application/x-webkit-test-netscape');
10 o.addEventListener('load', function () {
11 console.log('FAIL: The object should have been blocked.');
12 if (window.testRunner)
13 testRunner.notifyDone();
14 });
15 o.addEventListener('error', function () {
16 console.log('PASS: Error occurred, so load was correctly blocked.');
17 if (window.testRunner)
18 testRunner.notifyDone();
19 });
20
21 var p = document.createElement('param');
22 p.setAttribute('value', 'http://127.0.0.1:8080/plugins/resources/mock-pl ugin.pl?' + type);
23 p.setAttribute('name', type);
24
25 o.appendChild(p);
26
27 document.body.appendChild(o);
28 };
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698