diff --git a/dom/security/test/csp/file_child-src_shared_worker-redirect.html b/dom/security/test/csp/file_child-src_shared_worker-redirect.html index 9a0ace3a2c8..313915302ea 100644 --- a/dom/security/test/csp/file_child-src_shared_worker-redirect.html +++ b/dom/security/test/csp/file_child-src_shared_worker-redirect.html @@ -23,6 +23,12 @@ page_id); worker.port.start(); + worker.onerror = function(evt) { + evt.preventDefault(); + window.parent.postMessage({id:page_id, message:"blocked"}, + 'http://mochi.test:8888'); + } + worker.port.onmessage = function(ev) { window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888'); }; diff --git a/dom/security/test/csp/file_child-src_shared_worker.html b/dom/security/test/csp/file_child-src_shared_worker.html index 89fa95af631..0e9a56a294e 100644 --- a/dom/security/test/csp/file_child-src_shared_worker.html +++ b/dom/security/test/csp/file_child-src_shared_worker.html @@ -13,6 +13,12 @@ page_id); worker.port.start(); + worker.onerror = function(evt) { + evt.preventDefault(); + window.parent.postMessage({id:page_id, message:"blocked"}, + 'http://mochi.test:8888'); + } + worker.port.onmessage = function(ev) { window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888'); diff --git a/dom/security/test/csp/file_child-src_shared_worker_data.html b/dom/security/test/csp/file_child-src_shared_worker_data.html index 2f9a1f344ba..a4befe4ca34 100644 --- a/dom/security/test/csp/file_child-src_shared_worker_data.html +++ b/dom/security/test/csp/file_child-src_shared_worker_data.html @@ -18,6 +18,11 @@ escape(shared_worker), page_id); worker.port.start(); + worker.onerror = function(evt) { + evt.preventDefault(); + window.parent.postMessage({id:page_id, message:"blocked"}, 'http://mochi.test:8888'); + } + worker.port.onmessage = function(ev) { window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888'); }; diff --git a/dom/security/test/csp/file_child-src_worker-redirect.html b/dom/security/test/csp/file_child-src_worker-redirect.html index 381fecd4348..dbceec1cc92 100644 --- a/dom/security/test/csp/file_child-src_worker-redirect.html +++ b/dom/security/test/csp/file_child-src_worker-redirect.html @@ -24,11 +24,12 @@ worker.onerror = function(error) { var msg = error.message; - if (msg.match(/^: NetworkError/)) { + if (msg.match(/^: NetworkError/) || msg.match(/Failed to load script/)) { // this means CSP blocked it msg = "blocked"; } window.parent.postMessage({id:page_id, message:msg}, 'http://mochi.test:8888'); + error.preventDefault(); }; worker.onmessage = function(ev) { diff --git a/dom/security/test/csp/file_child-src_worker.html b/dom/security/test/csp/file_child-src_worker.html index 4c19c22422a..9300d3f6176 100644 --- a/dom/security/test/csp/file_child-src_worker.html +++ b/dom/security/test/csp/file_child-src_worker.html @@ -8,9 +8,16 @@ page_id = window.location.hash.substring(1); try { worker = new Worker('file_testserver.sjs?file='+escape("tests/dom/security/test/csp/file_child-src_worker.js")); + + worker.onerror = function(e) { + window.parent.postMessage({id:page_id, message:"blocked"}, 'http://mochi.test:8888'); + e.preventDefault(); + } + worker.onmessage = function(ev) { window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888'); - }; + } + worker.postMessage('foo'); } catch (e) { diff --git a/dom/security/test/csp/file_child-src_worker_data.html b/dom/security/test/csp/file_child-src_worker_data.html index b68b1adc2b9..e9e22f01da1 100644 --- a/dom/security/test/csp/file_child-src_worker_data.html +++ b/dom/security/test/csp/file_child-src_worker_data.html @@ -8,9 +8,16 @@ page_id = window.location.hash.substring(1); try { worker = new Worker('data:application/javascript;charset=UTF-8,'+escape('onmessage = function(e) { postMessage("worker"); };')); + + worker.onerror = function(e) { + window.parent.postMessage({id:page_id, message:"blocked"}, 'http://mochi.test:8888'); + e.preventDefault(); + } + worker.onmessage = function(ev) { window.parent.postMessage({id:page_id, message:"allowed"}, 'http://mochi.test:8888'); - }; + } + worker.postMessage('foo'); } catch (e) { diff --git a/testing/web-platform/meta/content-security-policy/blink-contrib/self-doesnt-match-blob.sub.html.ini b/testing/web-platform/meta/content-security-policy/blink-contrib/self-doesnt-match-blob.sub.html.ini new file mode 100644 index 00000000000..ac1b483bf3e --- /dev/null +++ b/testing/web-platform/meta/content-security-policy/blink-contrib/self-doesnt-match-blob.sub.html.ini @@ -0,0 +1,6 @@ +[self-doesnt-match-blob.sub.html] + type: testharness + expected: ERROR + + [Violation report status OK.] + expected: PASS diff --git a/testing/web-platform/meta/content-security-policy/blink-contrib/star-doesnt-match-blob.sub.html.ini b/testing/web-platform/meta/content-security-policy/blink-contrib/star-doesnt-match-blob.sub.html.ini new file mode 100644 index 00000000000..18613321673 --- /dev/null +++ b/testing/web-platform/meta/content-security-policy/blink-contrib/star-doesnt-match-blob.sub.html.ini @@ -0,0 +1,2 @@ +[star-doesnt-match-blob.sub.html] + expected: ERROR diff --git a/testing/web-platform/meta/content-security-policy/child-src/child-src-worker-blocked.sub.html.ini b/testing/web-platform/meta/content-security-policy/child-src/child-src-worker-blocked.sub.html.ini new file mode 100644 index 00000000000..3f45e69da88 --- /dev/null +++ b/testing/web-platform/meta/content-security-policy/child-src/child-src-worker-blocked.sub.html.ini @@ -0,0 +1,10 @@ +[child-src-worker-blocked.sub.html] + type: testharness + expected: ERROR + + [Expecting alerts: ["PASS"\]] + expected: PASS + expected: NOTRUN + + [Violation report status OK.] + expected: PASS diff --git a/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/keep-scheme-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/keep-scheme-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/keep-scheme-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/swap-scheme-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/swap-scheme-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/http-csp/cross-origin-http/worker-request/top-level/swap-scheme-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/keep-scheme-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/keep-scheme-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/keep-scheme-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/swap-scheme-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/swap-scheme-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/http-csp/same-host-http/worker-request/top-level/swap-scheme-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/meta-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/meta-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/meta-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/meta-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/meta-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..e5dd8ce5d2c --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/meta-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/keep-scheme-redirect/no-opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/keep-scheme-redirect/no-opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..093afeb8706 --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/keep-scheme-redirect/no-opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[no-opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/no-redirect/no-opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/no-redirect/no-opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..093afeb8706 --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/no-redirect/no-opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[no-opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/swap-scheme-redirect/no-opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/swap-scheme-redirect/no-opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..093afeb8706 --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/cross-origin-http/worker-request/top-level/swap-scheme-redirect/no-opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[no-opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/keep-scheme-redirect/no-opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/keep-scheme-redirect/no-opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..093afeb8706 --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/keep-scheme-redirect/no-opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[no-opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/no-redirect/no-opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/no-redirect/no-opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..093afeb8706 --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/no-redirect/no-opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[no-opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/swap-scheme-redirect/no-opt-in-blocks.https.html.ini b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/swap-scheme-redirect/no-opt-in-blocks.https.html.ini new file mode 100644 index 00000000000..093afeb8706 --- /dev/null +++ b/testing/web-platform/meta/mixed-content/blockable/no-opt-in/same-host-http/worker-request/top-level/swap-scheme-redirect/no-opt-in-blocks.https.html.ini @@ -0,0 +1,2 @@ +[no-opt-in-blocks.https.html] + expected: ERROR diff --git a/testing/web-platform/meta/workers/Worker_cross_origin_security_err.htm.ini b/testing/web-platform/meta/workers/Worker_cross_origin_security_err.htm.ini new file mode 100644 index 00000000000..f09f14db9ab --- /dev/null +++ b/testing/web-platform/meta/workers/Worker_cross_origin_security_err.htm.ini @@ -0,0 +1,4 @@ +[Worker_cross_origin_security_err.htm] + type: testharness + [ Worker cross-origin URL ] + expected: FAIL diff --git a/testing/web-platform/meta/workers/constructors/SharedWorker/same-origin.html.ini b/testing/web-platform/meta/workers/constructors/SharedWorker/same-origin.html.ini index 846f4e09f6b..00b312fdbc3 100644 --- a/testing/web-platform/meta/workers/constructors/SharedWorker/same-origin.html.ini +++ b/testing/web-platform/meta/workers/constructors/SharedWorker/same-origin.html.ini @@ -1,8 +1,26 @@ [same-origin.html] type: testharness + [unsupported_scheme] expected: FAIL [javascript_url] expected: FAIL + [about_blank] + expected: FAIL + + [opera_com] + expected: FAIL + + [port_81] + expected: FAIL + + [https_port_80] + expected: FAIL + + [https_port_8000] + expected: FAIL + + [http_port_8012] + expected: FAIL diff --git a/testing/web-platform/meta/workers/constructors/Worker/same-origin.html.ini b/testing/web-platform/meta/workers/constructors/Worker/same-origin.html.ini index 846f4e09f6b..5f07ff1dccf 100644 --- a/testing/web-platform/meta/workers/constructors/Worker/same-origin.html.ini +++ b/testing/web-platform/meta/workers/constructors/Worker/same-origin.html.ini @@ -6,3 +6,20 @@ [javascript_url] expected: FAIL + [about_blank] + expected: FAIL + + [example_invalid] + expected: FAIL + + [port_81] + expected: FAIL + + [https_port_80] + expected: FAIL + + [https_port_8000] + expected: FAIL + + [http_post_8012] + expected: FAIL