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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/credentials/authentication-basic.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("/resources/testharness.js");
3 importScripts("../resources/utils.js");
4 }
5
6 function basicAuth(desc, user, pass, mode, status) {
7 promise_test(function(test) {
8 var headers = { "Authorization": "Basic " + btoa(user + ":" + pass)};
9 var requestInit = {"credentials": mode, "headers": headers};
10 return fetch(RESOURCES_DIR + "authentication.py?realm=test", requestInit).th en(function(resp) {
11 assert_equals(resp.status, status, "HTTP status is " + status);
12 assert_equals(resp.type , "basic", "Response's type is basic");
13 });
14 }, desc);
15 }
16
17 basicAuth("User-added Authorization header with include mode", "user", "password ", "include", 200);
18 basicAuth("User-added Authorization header with same-origin mode", "user", "pass word", "same-origin", 200);
19 basicAuth("User-added Authorization header with omit mode", "user", "password", "omit", 200);
20
21 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698