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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/DOMFormData.h » ('j') | Source/modules/fetch/Body.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« 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