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 6b928ea49287c10d6b7713dc2555cebd58dd6bde..2085321baed8b4e9b0bd7c92ae54dd8e39e5ce06 100644 |
--- a/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html |
+++ b/LayoutTests/http/tests/credentialmanager/passwordcredential-basics.html |
@@ -8,20 +8,18 @@ test(function() { |
var credential = new PasswordCredential('id', 'pencil', 'name', 'https://example.com/icon.png'); |
verify_interface('PasswordCredential', credential, { |
- formData: 'object', |
id: 'string', |
name: 'string', |
iconURL: 'string', |
- password: 'string', |
type: 'string' |
}); |
- assert_true(credential.formData instanceof FormData); |
assert_equals(credential.id, 'id'); |
assert_equals(credential.name, 'name'); |
assert_equals(credential.iconURL, 'https://example.com/icon.png'); |
- assert_equals(credential.password, 'pencil'); |
assert_equals(credential.type, 'password'); |
+ |
+ assert_true(credential.toFormData() instanceof FormData); |
}, 'Interfaces and attributes of PasswordCredential'); |
test(function() { |
@@ -36,8 +34,8 @@ test(function() { |
assert_equals(credential.id, 'id'); |
assert_equals(credential.name, 'name'); |
assert_equals(credential.iconURL, ''); |
- assert_equals(credential.password, 'pencil'); |
assert_equals(credential.type, 'password'); |
+ assert_true(credential.toFormData() instanceof FormData); |
}, 'Construct a PasswordCredential with an empty icon URL.'); |
@@ -47,8 +45,35 @@ test(function() { |
assert_equals(credential.id, 'id'); |
assert_equals(credential.name, ''); |
assert_equals(credential.iconURL, ''); |
- assert_equals(credential.password, 'pencil'); |
assert_equals(credential.type, 'password'); |
- |
+ assert_true(credential.toFormData() instanceof FormData); |
}, 'Construct a PasswordCredential with an empty name and icon URL.'); |
+ |
+test(function() { |
+ 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'); |
+ |
+ assert_equals(fd.get('n1'), null); |
+ assert_equals(fd.get('n2'), null); |
+ assert_equals(fd.get('n3'), null); |
+ |
+ assert_equals(fd.has('n1'), false); |
+ assert_equals(fd.has('n2'), false); |
+ assert_equals(fd.has('n3'), false); |
+ |
+ assert_array_equals(fd.getAll('n1'), []); |
+ assert_array_equals(fd.getAll('n2'), []); |
+ assert_array_equals(fd.getAll('n3'), []); |
+ |
+ for(var entry of fd) { |
+ assert_unreached("There should be nothing to iterate here."); |
+ } |
+}, 'Verify properties of opaque FormData.'); |
</script> |