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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/child-src-test.js

Issue 2803943007: Un-skipped wpt csp child-src tests (Closed)
Patch Set: Created 3 years, 8 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: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/child-src-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/child-src-test.js b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/child-src-test.js
deleted file mode 100644
index 83b58852ae8a8f389c0eee611c4cb76113f797d7..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/child-src-test.js
+++ /dev/null
@@ -1,65 +0,0 @@
-var EXPECT_BLOCK = true;
-var EXPECT_LOAD = false;
-
-window.jsTestIsAsync = true;
-window.wasPostTestScriptParsed = true;
-
-var iframe;
-function injectFrame(url, shouldBlock) {
- window.onload = function () {
- iframe = document.createElement('iframe');
- iframe.onload = iframeLoaded(shouldBlock);
- iframe.src = url;
- document.body.appendChild(iframe);
- };
-}
-
-function iframeLoaded(expectBlock) {
- return function(ev) {
- var failed = true;
- try {
- console.log("IFrame load event fired: the IFrame's location is '" + ev.target.contentWindow.location.href + "'.");
- if (expectBlock) {
- testFailed("The IFrame should have been blocked (or cross-origin). It wasn't.");
- failed = true;
- } else {
- testPassed("The IFrame should not have been blocked. It wasn't.");
- failed = false;
- }
- } catch (ex) {
- debug("IFrame load event fired: the IFrame is cross-origin (or was blocked).");
- if (expectBlock) {
- testPassed("The IFrame should have been blocked (or cross-origin). It was.");
- failed = false;
- } else {
- testFailed("The IFrame should not have been blocked. It was.");
- failed = true;
- }
- }
- finishJSTest();
- };
-}
-
-function injectFrameRedirectingTo(url, shouldBlock) {
- injectFrame("/security/contentSecurityPolicy/resources/redir.php?url=" + url, shouldBlock);
-}
-
-function injectWorker(url, expectBlock) {
- window.onload = function() {
- if (expectBlock == EXPECT_BLOCK)
- shouldThrow("var w = new Worker('" + url + "');");
- else
- shouldNotThrow("var w = new Worker('" + url + "');");
- finishJSTest();
- };
-}
-
-function injectSharedWorker(url, expectBlock) {
- window.onload = function() {
- if (expectBlock == EXPECT_BLOCK)
- shouldThrow("var w = new SharedWorker('" + url + "');");
- else
- shouldNotThrow("var w = new SharedWorker('" + url + "');");
- finishJSTest();
- };
-}
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-redirect-blocked-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698