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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/fetch-serviceworker.html

Issue 1847383003: CREDENTIAL: Rework the integration with Fetch (2/2) Base URL: https://chromium.googlesource.com/chromium/src.git@pass-serialized
Patch Set: unittest Created 4 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 <script>
2 var c = new PasswordCredential({
3 id: 'id',
4 password: 'pencil',
5 name: 'name',
6 iconURL: 'https://example.com/icon.png'
7 });
8
9 function testServiceWorkerVisibility() {
10 return new Promise((resolve, reject) => {
11 fetch(window.location.pathname + "?respond-with-body", { credentials : c, method: 'POST' })
12 .then(r => r.json())
13 .then(j => {
14 if (j.credentials != 'password')
15 reject("Credentials was '" + j.credentials + "'");
philipj_slow 2016/04/06 13:33:00 Since you're using fancy new arrow functions, you
16 if (j.body != '')
17 reject("Body was '" + j.body + "'");
18 resolve();
19 });
20 });
21 }
22
23 function testServiceWorkerNetworkVisibility() {
24 return new Promise((resolve, reject) => {
25 fetch("./echo-post.php", { credentials: c, method: "POST" })
26 .then(r => r.json())
27 .then(j => {
28 if (j.username != 'id')
29 reject("Username was '" + j.username + "'");
30 if (j.password != 'pencil')
31 reject("Password was '" + j.password + "'");
32 resolve();
33 });
34 });
35 }
horo 2016/04/04 05:32:17 Please add tests for 1. e.respondWith(fetch(e.requ
36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698