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

Side by Side Diff: LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html

Issue 1305183009: CREDENTIAL: Extend FormData opacity to created Request objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Initializing variables is a good idea. Created 5 years, 3 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 | Source/core/html/DOMFormData.h » ('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 <script> 6 <script>
7 test(function() { 7 test(function() {
8 var credential = new PasswordCredential('id', 'pencil', 'name', 'https://exa mple.com/icon.png'); 8 var credential = new PasswordCredential('id', 'pencil', 'name', 'https://exa mple.com/icon.png');
9 9
10 verify_interface('PasswordCredential', credential, { 10 verify_interface('PasswordCredential', credential, {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 assert_equals(fd.has('n3'), false); 69 assert_equals(fd.has('n3'), false);
70 70
71 assert_array_equals(fd.getAll('n1'), []); 71 assert_array_equals(fd.getAll('n1'), []);
72 assert_array_equals(fd.getAll('n2'), []); 72 assert_array_equals(fd.getAll('n2'), []);
73 assert_array_equals(fd.getAll('n3'), []); 73 assert_array_equals(fd.getAll('n3'), []);
74 74
75 for(var entry of fd) { 75 for(var entry of fd) {
76 assert_unreached("There should be nothing to iterate here."); 76 assert_unreached("There should be nothing to iterate here.");
77 } 77 }
78 }, 'Verify properties of opaque FormData.'); 78 }, 'Verify properties of opaque FormData.');
79
80 function verifyBodyMethodBehavior(t, req, methodName) {
81 req[methodName]().then(
82 t.unreached_func("The 'Body::" + methodName + "()' method should reject. "),
83 t.step_func_done(function (e) { assert_equals(e.name, "TypeError"); }));
84 }
85
86 // TODO(mkwst): 'Body' doesn't yet implement 'formData()'.
87 ['arrayBuffer', 'blob', 'json', 'text'].forEach(function (methodName) {
88 async_test(function (t) {
89 var credential = new PasswordCredential('id', 'pencil');
90 var fd = credential.toFormData();
91 fd.append('n1', 'v1');
92 fd.append('n2', 'v2');
93 fd.append('n3', 'v3');
94 fd.append('n1', 'v4');
95 fd.append('n2', 'v5');
96 fd.append('n3', 'v6');
97
98 t.step(function () {
99 var r = new Request("http://127.0.0.1:8000", { body: fd, method: "PO ST" });
100 verifyBodyMethodBehavior(t, r, methodName);
101 });
102
103 }, "Verify behavior of 'Body::" + methodName + "()' for opaque Requests.");
104 });
79 </script> 105 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/DOMFormData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698