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

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

Issue 1918253002: CREDENTIAL: Credentials should be submitted within a registrable domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: vabr@ 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/echo-post.php » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Credential Manager: PasswordCredential same-registrable-domain fetching.< /title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script>
6 // Move to a subdomain of `example.test` for testing:
7 if (document.location.hostname == "127.0.0.1") {
8 document.location.hostname = "subdomain.example.test";
9 } else {
10 var c = new PasswordCredential({
11 id: 'id',
12 password: 'pencil',
13 name: 'name',
14 iconURL: 'https://example.com/icon.png'
15 });
16
17 promise_test(function() {
18 var r1 = new Request('./resources/echo-post.php', { credentials: c, meth od: "POST" });
19 return fetch(r1)
20 .then(resp => resp.json())
21 .then(j => {
22 assert_equals(j.username, 'id');
23 assert_equals(j.password, 'pencil');
24 });
25 }, "Same-origin fetch.");
26
27 promise_test(function() {
28 var r1 = new Request('http://example.test:8000/credentialmanager/resourc es/echo-post.php', { credentials: c, method: "POST" });
29 return fetch(r1)
30 .then(resp => resp.json())
31 .then(j => {
32 assert_equals(j.username, 'id');
33 assert_equals(j.password, 'pencil');
34 });
35 }, "Fetch from `subdomain.example.test` => `example.test`.");
36
37 promise_test(function() {
38 var r1 = new Request('http://other.example.test:8000/credentialmanager/r esources/echo-post.php', { credentials: c, method: "POST" });
39 return fetch(r1)
40 .then(resp => resp.json())
41 .then(j => {
42 assert_equals(j.username, 'id');
43 assert_equals(j.password, 'pencil');
44 });
45 }, "Fetch from `subdomain.example.test` => `other.example.test`.");
46
47 promise_test(function() {
48 var r1 = new Request('http://other.subdomain.example.test:8000/credentia lmanager/resources/echo-post.php', { credentials: c, method: "POST" });
49 return fetch(r1)
50 .then(resp => resp.json())
51 .then(j => {
52 assert_equals(j.username, 'id');
53 assert_equals(j.password, 'pencil');
54 });
55 }, "Fetch from `subdomain.example.test` => `other.subdomain.example.test`.") ;
56 }
57 </script>
58
59
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/echo-post.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698