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

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

Issue 2456013002: CSP: 'connect-src' should not cause exceptions. (Closed)
Patch Set: Ugh. 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-allow.sub.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-allow.sub.js b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-allow.sub.js
index 97a32179e591c3a57d50442d947948ec246e1790..7ba44e53634311ec1100a5a3aa2565ec9248ba00 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-allow.sub.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/support/connect-src-allow.sub.js
@@ -15,12 +15,9 @@ async_test(t => {
assert_no_csp_event_for_url(t, url);
var xhr = new XMLHttpRequest();
- try {
- xhr.open("GET", url);
- t.done();
- } catch (e) {
- assert_unreached();
- }
+ xhr.open("GET", url);
+ xhr.onload = t.step_func_done();
+ xhr.onerror = t.unreached_func();
xhr.send();
}, "Same-origin XHR in " + self.location.protocol + self.location.search);
@@ -38,12 +35,9 @@ async_test(t => {
assert_no_csp_event_for_url(t, url);
var xhr = new XMLHttpRequest();
- try {
- xhr.open("GET", url);
- t.done();
- } catch (e) {
- assert_unreached();
- }
+ xhr.open("GET", url);
+ xhr.onload = t.step_func_done();
+ xhr.onerror = t.unreached_func();
xhr.send();
}, "Cross-origin XHR in " + self.location.protocol + self.location.search);

Powered by Google App Engine
This is Rietveld 408576698