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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/cors-rfc1918/external-to-internal-fetch.html

Issue 1745083002: CORS-RFC1918: Force preflights for external requests in DocumentThreadableLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test. Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Security-Policy" content="treat-as-public-address" >
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <script src="./resources/preflight.js"></script>
8 </head>
9 <body>
10 <script>
11 promise_test(function (t) {
12 return promise_rejects(t, new TypeError(), fetch(preflightURL('fail- with-500', 'json')));
13 }, "'fetch()' should fail on failed preflight: 500 status");
14
15 promise_test(function (t) {
16 return promise_rejects(t, new TypeError(), fetch(preflightURL('fail- without-allow', 'json')));
17 }, "'fetch()' should fail on failed preflight: no allow-external");
18
19 promise_test(function (t) {
20 return fetch(preflightURL('pass', 'json'))
21 .then(function (response) {
22 return response.json();
23 }).then(function (json) {
24 assert_equals('success', json.jsonpResult);
25 });
26 }, "'fetch()' should pass on successful preflight");
27 </script>
28 </body>
29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698