Chromium Code Reviews| Index: LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html |
| diff --git a/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html b/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html |
| index 2085321baed8b4e9b0bd7c92ae54dd8e39e5ce06..2db89e139239a47f7962d9f2a828e972d1639fa3 100644 |
| --- a/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html |
| +++ b/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html |
| @@ -76,4 +76,64 @@ test(function() { |
| assert_unreached("There should be nothing to iterate here."); |
| } |
| }, 'Verify properties of opaque FormData.'); |
| + |
| +(function() { |
|
philipj_slow
2015/09/02 12:12:48
I guess this is consistent with other tests around
|
| + var t = async_test("Verify properties of opaque Requests."); |
| + |
| + var credential = new PasswordCredential('id', 'pencil'); |
| + var fd = credential.toFormData(); |
| + fd.append('n1', 'v1'); |
| + fd.append('n2', 'v2'); |
| + fd.append('n3', 'v3'); |
| + fd.append('n1', 'v4'); |
| + fd.append('n2', 'v5'); |
| + fd.append('n3', 'v6'); |
| + |
| + t.step(function () { |
| + var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" }); |
| + r.arrayBuffer().then( |
| + t.step_func(function (data) { |
|
philipj_slow
2015/09/02 12:12:48
t.unreached_func("The arrayBuffer() method should
|
| + assert_unreached("The arrayBuffer() method should reject.") |
| + }), |
| + 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
|
| + assert_equals(e.name, "TypeError"); |
| + t.done(); |
| + })); |
| + }); |
| + t.step(function () { |
| + var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" }); |
| + r.blob().then( |
|
philipj_slow
2015/09/02 12:12:48
It looks like you could share all of the duplicate
|
| + t.step_func(function (data) { |
| + assert_unreached("The blob() method should reject.") |
| + }), |
| + t.step_func(function (e) { |
| + assert_equals(e.name, "TypeError"); |
| + t.done(); |
| + })); |
| + }); |
| + t.step(function () { |
| + var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" }); |
| + r.json().then( |
| + t.step_func(function (data) { |
| + assert_unreached("The json() method should reject.") |
| + }), |
| + t.step_func(function (e) { |
| + assert_equals(e.name, "TypeError"); |
| + t.done(); |
| + })); |
| + }); |
| + t.step(function () { |
| + var r = new Request("http://127.0.0.1:8000", { body: fd, method: "POST" }); |
| + r.text().then( |
| + t.step_func(function (data) { |
| + assert_unreached("The text() method should reject.") |
| + }), |
| + t.step_func(function (e) { |
| + assert_equals(e.name, "TypeError"); |
| + t.done(); |
| + })); |
| + }); |
| + |
| + |
| +}()); |
| </script> |