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

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

Issue 2482443002: Fix a 'promise_test' bug in 'http/tests/credentialmanager/passwordcredential-fetch.html'. (Closed)
Patch Set: Expectation. Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-fetch-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Credential Manager: PasswordCredential basics.</title> 2 <title>Credential Manager: PasswordCredential basics.</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="/serviceworker/resources/interfaces.js"></script> 5 <script src="/serviceworker/resources/interfaces.js"></script>
6 <body> 6 <body>
7 <input type=hidden id=thing value=sekrit> 7 <input type=hidden id=thing value=sekrit>
8 <script> 8 <script>
9 add_completion_callback(() => { 9 add_completion_callback(() => {
10 if (window.testRunner) 10 if (window.testRunner)
(...skipping 21 matching lines...) Expand all
32 var r = new Request('/', { credentials: c, method: 'POST' }); 32 var r = new Request('/', { credentials: c, method: 'POST' });
33 var clone = r.clone(); 33 var clone = r.clone();
34 assert_equals(r.credentials, "password"); 34 assert_equals(r.credentials, "password");
35 assert_equals(clone.credentials, "password"); 35 assert_equals(clone.credentials, "password");
36 return Promise.all([ 36 return Promise.all([
37 r.text().then(t => assert_equals(t, "")), 37 r.text().then(t => assert_equals(t, "")),
38 clone.text().then(t => assert_equals(t, "")) 38 clone.text().then(t => assert_equals(t, ""))
39 ]); 39 ]);
40 }, "Creating/cloning a 'Request' does not expose the credential."); 40 }, "Creating/cloning a 'Request' does not expose the credential.");
41 41
42 promise_test(_ => { 42 test(_ => {
43 assert_throws(new TypeError(), _ => new Request("https://cross-origin.exampl e.test/", { credentials: c, method: 'POST' })); 43 assert_throws(new TypeError(), _ => new Request("https://cross-origin.exampl e.test/", { credentials: c, method: 'POST' }));
44 assert_throws(new TypeError(), _ => new Request("/", { credentials: c, metho d: 'GET' })); 44 assert_throws(new TypeError(), _ => new Request("/", { credentials: c, metho d: 'GET' }));
45 assert_throws(new TypeError(), _ => new Request("/", { credentials: c, metho d: 'HEAD' })); 45 assert_throws(new TypeError(), _ => new Request("/", { credentials: c, metho d: 'HEAD' }));
46 assert_throws(new TypeError(), _ => new Request("/", { credentials: 'passwor d', method: 'POST' })); 46 assert_throws(new TypeError(), _ => new Request("/", { credentials: 'passwor d', method: 'POST' }));
47 assert_throws(new TypeError(), _ => new Request("/", { credentials: 'passwor d', method: 'GET' })); 47 assert_throws(new TypeError(), _ => new Request("/", { credentials: 'passwor d', method: 'GET' }));
48 assert_throws(new TypeError(), _ => new Request("/", { credentials: 'passwor d', body: "Body", method: 'GET' })); 48 assert_throws(new TypeError(), _ => new Request("/", { credentials: 'passwor d', body: "Body", method: 'GET' }));
49 }, "Creating a 'Request' throws in various ways."); 49 }, "Creating a 'Request' throws in various ways.");
50 50
51 promise_test(function() { 51 promise_test(function() {
52 return fetch("./resources/echo-post.php", { credentials: c, method: "POST" } ) 52 return fetch("./resources/echo-post.php", { credentials: c, method: "POST" } )
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 return fetch("./resources/echo-post.php", { credentials: c, method: "POST" }) 401 return fetch("./resources/echo-post.php", { credentials: c, method: "POST" })
402 .then(resp => resp.json()) 402 .then(resp => resp.json())
403 .then(j => { 403 .then(j => {
404 assert_equals(j.username, 'id'); 404 assert_equals(j.username, 'id');
405 assert_equals(j.password, 'pencil') 405 assert_equals(j.password, 'pencil')
406 assert_equals(j.csrf_token, 'sekrit') 406 assert_equals(j.csrf_token, 'sekrit')
407 }); 407 });
408 }); 408 });
409 }, 'fetch() after get() with additionalData from DOM'); 409 }, 'fetch() after get() with additionalData from DOM');
410 </script> 410 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/credentialmanager/passwordcredential-fetch-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698