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

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: 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') | Source/modules/fetch/Body.cpp » ('J')
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() {
philipj_slow 2015/09/02 12:12:48 I guess this is consistent with other tests around
81 var t = async_test("Verify properties of opaque Requests.");
82
83 var credential = new PasswordCredential('id', 'pencil');
84 var fd = credential.toFormData();
85 fd.append('n1', 'v1');
86 fd.append('n2', 'v2');
87 fd.append('n3', 'v3');
88 fd.append('n1', 'v4');
89 fd.append('n2', 'v5');
90 fd.append('n3', 'v6');
91
92 t.step(function () {
93 var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" });
94 r.arrayBuffer().then(
95 t.step_func(function (data) {
philipj_slow 2015/09/02 12:12:48 t.unreached_func("The arrayBuffer() method should
96 assert_unreached("The arrayBuffer() method should reject.")
97 }),
98 t.step_func(function (e) {
philipj_slow 2015/09/02 12:12:48 Can use step_func_done if you like, it doesn't mak
99 assert_equals(e.name, "TypeError");
100 t.done();
101 }));
102 });
103 t.step(function () {
104 var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" });
105 r.blob().then(
philipj_slow 2015/09/02 12:12:48 It looks like you could share all of the duplicate
106 t.step_func(function (data) {
107 assert_unreached("The blob() method should reject.")
108 }),
109 t.step_func(function (e) {
110 assert_equals(e.name, "TypeError");
111 t.done();
112 }));
113 });
114 t.step(function () {
115 var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" });
116 r.json().then(
117 t.step_func(function (data) {
118 assert_unreached("The json() method should reject.")
119 }),
120 t.step_func(function (e) {
121 assert_equals(e.name, "TypeError");
122 t.done();
123 }));
124 });
125 t.step(function () {
126 var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" });
127 r.text().then(
128 t.step_func(function (data) {
129 assert_unreached("The text() method should reject.")
130 }),
131 t.step_func(function (e) {
132 assert_equals(e.name, "TypeError");
133 t.done();
134 }));
135 });
136
137
138 }());
79 </script> 139 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/DOMFormData.h » ('j') | Source/modules/fetch/Body.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698