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

Unified Diff: LayoutTests/http/tests/security/contentSecurityPolicy/worker-without-own-csp.html

Issue 1128813003: Give shared workers their own content security policies (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 7 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/worker-without-own-csp.html
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/worker-without-own-csp.html b/LayoutTests/http/tests/security/contentSecurityPolicy/worker-without-own-csp.html
index 9f32a1c6c2e4291b017c42115879f3eedbda3ae4..5f81202316a0dc4a7e5ec29f4cb74e76fb5c867c 100644
--- a/LayoutTests/http/tests/security/contentSecurityPolicy/worker-without-own-csp.html
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/worker-without-own-csp.html
@@ -9,6 +9,7 @@
<script>
// If the worker does not get served with a CSP header, than it should
// have no CSP, not the CSP of the responsible document.
+
async_test(function () {
var worker = new Worker('http://127.0.0.1:8000/security/contentSecurityPolicy/resources/worker.php?type=make-xhr');
worker.onmessage = this.step_func(function (event) {
@@ -16,6 +17,15 @@
this.done();
});
}, "Worker should not inherit document's CSP");
+
+ async_test(function () {
+ var worker = new SharedWorker('http://127.0.0.1:8000/security/contentSecurityPolicy/resources/worker.php?type=shared-make-xhr');
+ worker.port.onmessage = this.step_func(function (event) {
+ assert_equals("xhr allowed", event.data);
+ this.done();
+ });
+ worker.port.start();
+ }, "Shared worker should not inherit document's CSP");
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698