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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/security/contentSecurityPolicy/resources/object-src-param.js
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/resources/object-src-param.js b/LayoutTests/http/tests/security/contentSecurityPolicy/resources/object-src-param.js
new file mode 100644
index 0000000000000000000000000000000000000000..44a7f7ca73ab938c51422bf8c5e78930d54d83d8
--- /dev/null
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/resources/object-src-param.js
@@ -0,0 +1,29 @@
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+function appendObjectElement(type) {
+ window.onload = function () {
+ var o = document.createElement('object');
+ o.setAttribute('type', 'application/x-webkit-test-netscape');
+ o.addEventListener('load', function () {
+ console.log('FAIL: The object should have been blocked.');
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ o.addEventListener('error', function () {
+ console.log('PASS: Error occurred, so load was correctly blocked.');
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+
+ var p = document.createElement('param');
+ p.setAttribute('value', 'http://127.0.0.1:8080/plugins/resources/mock-plugin.pl?' + type);
+ p.setAttribute('name', type);
+
+ o.appendChild(p);
+
+ document.body.appendChild(o);
+ };
+}

Powered by Google App Engine
This is Rietveld 408576698