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

Side by Side Diff: LayoutTests/http/tests/fetch/script-tests/thorough/scheme-data.js

Issue 1283163003: [Fetch][WIP] Support blob:, about:, and data: URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup. Created 5 years, 3 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 if (self.importScripts) {
2 importScripts('/fetch/resources/fetch-test-helpers.js');
3 importScripts('/fetch/resources/thorough-util.js');
4 }
5
6 var url = "data:application/json,report({jsonpResult: 'success'});";
7
8 var TEST_TARGETS = [
9 // data: requests.
10 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=GET',
11 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ eBasic],
12 [checkJsonpSuccess]],
13 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=cors&method=GET',
14 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ eBasic],
15 [checkJsonpSuccess]],
16 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=no-cors&method=GET',
17 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ eBasic],
18 [checkJsonpSuccess]],
19
20 // data: requests with non-GET methods.
21 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=POST' ,
22 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ eBasic],
23 [checkJsonpSuccess]],
24 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=HEAD' ,
25 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ eBasic],
26 [checkJsonpSuccess]],
27
28 // data: requests with same-origin redirects.
29 [REDIRECT_URL + encodeURIComponent(url) + '&mode=same-origin&method=GET',
30 [fetchRejected]],
31 [REDIRECT_URL + encodeURIComponent(url) + '&mode=cors&method=GET',
32 [fetchRejected]],
33
34 // data: requests with cross-origin redirects.
35 [OTHER_REDIRECT_URL + encodeURIComponent(url) +
36 '&mode=same-origin&method=GET&ACAOrigin=*',
37 [fetchRejected]],
38 [OTHER_REDIRECT_URL + encodeURIComponent(url) +
39 '&mode=cors&method=GET&ACAOrigin=*',
40 [fetchRejected]],
41 ];
42
43 if (self.importScripts) {
44 executeTests(TEST_TARGETS);
45 done();
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698