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

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: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/DOMFormData.h » ('j') | no next file with comments »
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..f56f3a76d3d1ac51f5dd3da9cf5244011273427d 100644
--- a/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html
+++ b/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html
@@ -76,4 +76,30 @@ test(function() {
assert_unreached("There should be nothing to iterate here.");
}
}, 'Verify properties of opaque FormData.');
+
+function verifyBodyMethodBehavior(t, req, methodName) {
+ req[methodName]().then(
+ t.unreached_func("The 'Body::" + methodName + "()' method should reject."),
+ t.step_func_done(function (e) { assert_equals(e.name, "TypeError"); }));
+}
+
+// TODO(mkwst): 'Body' doesn't yet implement 'formData()'.
+['arrayBuffer', 'blob', 'json', 'text'].forEach(function (methodName) {
+ async_test(function (t) {
+ 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" });
+ verifyBodyMethodBehavior(t, r, methodName);
+ });
+
+ }, "Verify behavior of 'Body::" + methodName + "()' for opaque Requests.");
+});
</script>
« 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