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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/redirect/redirect-to-dataurl.js

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 8 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 (this.document === undefined) {
2 importScripts("/common/get-host-info.sub.js")
3 importScripts("/resources/testharness.js");
4 }
5
6 var dataURL = "data:text/plain;base64,cmVzcG9uc2UncyBib2R5";
7 var body = "response's body";
8 var contentType = "text/plain";
9
10 function redirectDataURL(desc, redirectUrl, mode) {
11 var url = redirectUrl + "?cors&location=" + encodeURIComponent(dataURL);
12
13 var requestInit = {"mode": mode};
14
15 promise_test(function(test) {
16 return promise_rejects(test, new TypeError(), fetch(url, requestInit));
17 }, desc);
18 }
19
20 var redirUrl = get_host_info().HTTP_ORIGIN + "/fetch/api/resources/redirect.py";
21 var corsRedirUrl = get_host_info().HTTP_REMOTE_ORIGIN + "/fetch/api/resources/re direct.py";
22
23 redirectDataURL("Testing data URL loading after same-origin redirection (cors mo de)", redirUrl, "cors");
24 redirectDataURL("Testing data URL loading after same-origin redirection (no-cors mode)", redirUrl, "no-cors");
25 redirectDataURL("Testing data URL loading after same-origin redirection (same-or igin mode)", redirUrl, "same-origin");
26
27 redirectDataURL("Testing data URL loading after cross-origin redirection (cors m ode)", corsRedirUrl, "cors");
28 redirectDataURL("Testing data URL loading after cross-origin redirection (no-cor s mode)", corsRedirUrl, "no-cors");
29
30 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698