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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-self.sub.js

Issue 2765443003: CSP: Upstream worker tests to WPT repository. (Closed)
Patch Set: Created 3 years, 9 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/external/wpt/content-security-policy/inside-worker/support/connect-src-self.sub.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/workers/resources/connect-src-self.js b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-self.sub.js
similarity index 52%
rename from third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/workers/resources/connect-src-self.js
rename to third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-self.sub.js
index aaf3554804b031578a05739c6dac1ea092dd39ef..f7332e35ba2da2f8902209e53e2600cf5347f057 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/workers/resources/connect-src-self.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-self.sub.js
@@ -1,17 +1,17 @@
-importScripts("http://127.0.0.1:8000/resources/testharness.js");
-importScripts("http://127.0.0.1:8000/security/contentSecurityPolicy/resources/testharness-helper.js");
+importScripts("{{location[server]}}/resources/testharness.js");
+importScripts("{{location[server]}}/content-security-policy/support/testharness-helper.js");
// Same-origin
async_test(t => {
- var url = "http://127.0.0.1:8000/security/resources/cors-hello.php?same-origin-fetch";
+ var url = "{{location[server]}}/common/text-plain.txt?same-origin-fetch";
assert_no_csp_event_for_url(t, url);
fetch(url)
.then(t.step_func_done(r => assert_equals(r.status, 200)));
-}, "Same-origin 'fetch()' in " + self.location.protocol);
+}, "Same-origin 'fetch()' in " + self.location.protocol + self.location.search);
async_test(t => {
- var url = "http://127.0.0.1:8000/security/resources/cors-hello.php?same-origin-xhr";
+ var url = "{{location[server]}}/common/text-plain.txt?same-origin-xhr";
assert_no_csp_event_for_url(t, url);
var xhr = new XMLHttpRequest();
@@ -22,21 +22,21 @@ async_test(t => {
assert_unreached();
}
xhr.send();
-}, "Same-origin XHR in " + self.location.protocol);
+}, "Same-origin XHR in " + self.location.protocol + self.location.search);
// Cross-origin
async_test(t => {
- var url = "http://example.test:8000/security/resources/cors-hello.php?cross-origin-fetch";
+ var url = "http://{{domains[www]}}:{{ports[http][1]}}/common/text-plain.txt?cross-origin-fetch";
Promise.all([
waitUntilCSPEventForURL(t, url),
fetch(url)
.catch(t.step_func(e => assert_true(e instanceof TypeError)))
]).then(_ => t.done());
-}, "Cross-origin 'fetch()' in " + self.location.protocol);
+}, "Cross-origin 'fetch()' in " + self.location.protocol + self.location.search);
async_test(t => {
- var url = "http://example.test:8000/security/resources/cors-hello.php?cross-origin-xhr";
+ var url = "http://{{domains[www]}}:{{ports[http][1]}}/common/text-plain.txt?cross-origin-xhr";
Promise.all([
waitUntilCSPEventForURL(t, url),
@@ -50,15 +50,15 @@ async_test(t => {
}
})
]).then(_ => t.done());
-}, "Cross-origin XHR in " + self.location.protocol);
+}, "Cross-origin XHR in " + self.location.protocol + self.location.search);
// Same-origin redirecting to cross-origin
async_test(t => {
- var url = "http://127.0.0.1:8000/security/resources/redir.php?url=http://example.test:8000/security/resources/cors-hello.php?cross-origin-fetch";
+ var url = "{{location[server]}}/common/redirect-opt-in.py?status=307&location=http://{{domains[www]}}:{{ports[http][1]}}/common/text-plain.txt?cross-origin-fetch";
// TODO(mkwst): The event should be firing. :(
fetch(url)
.catch(t.step_func_done(e => assert_true(e instanceof TypeError)))
-}, "Same-origin => cross-origin 'fetch()' in " + self.location.protocol);
+}, "Same-origin => cross-origin 'fetch()' in " + self.location.protocol + self.location.search);
done();

Powered by Google App Engine
This is Rietveld 408576698