| <!DOCTYPE html> |
| <script src=/resources/testharness.js></script> |
| <script src=/resources/testharnessreport.js></script> |
| <script src=/w3c/resources/WebIDLParser.js></script> |
| <script src=/w3c/resources/idlharness.js></script> |
| <script type="text/plain" id="untested"> |
| dictionary CredentialData { |
| USVString id; |
| }; |
| |
| interface Credential { |
| readonly attribute USVString id; |
| readonly attribute DOMString type; |
| }; |
| |
| dictionary SiteBoundCredentialData : CredentialData { |
| USVString name; |
| USVString iconURL; |
| }; |
| |
| interface SiteBoundCredential : Credential { |
| readonly attribute USVString name; |
| readonly attribute USVString iconURL; |
| }; |
| |
| dictionary PasswordCredentialData : SiteBoundCredentialData { |
| USVString password; |
| }; |
| |
| typedef (FormData or URLSearchParams) CredentialBodyType; |
| |
| |
| dictionary FederatedCredentialData : SiteBoundCredentialData { |
| USVString provider; |
| DOMString protocol; |
| }; |
| |
| dictionary CredentialRequestOptions { |
| boolean password = false; |
| FederatedCredentialRequestOptions federated; |
| |
| boolean unmediated = false; |
| }; |
| |
| dictionary FederatedCredentialRequestOptions { |
| sequence<USVString> providers; |
| sequence<DOMString> protocols; |
| }; |
| |
| </script> |
| <script type="text/plain" id="tested"> |
| interface CredentialsContainer { |
| Promise<Credential?> get(CredentialRequestOptions options); |
| Promise<Credential> store(Credential credential); |
| Promise<void> requireUserMediation(); |
| }; |
| |
| [Constructor(PasswordCredentialData data), |
| Constructor(HTMLFormElement form), |
| Exposed=Window] |
| interface PasswordCredential : SiteBoundCredential { |
| attribute USVString idName; |
| attribute USVString passwordName; |
| |
| attribute CredentialBodyType? additionalData; |
| }; |
| |
| [Constructor(FederatedCredentialData data), Exposed=Window] |
| interface FederatedCredential : SiteBoundCredential { |
| readonly attribute USVString provider; |
| readonly attribute DOMString? protocol; |
| }; |
| </script> |
| <script> |
| "use strict"; |
| var idl_array = new IdlArray(); |
| idl_array.add_untested_idls(document.querySelector('#untested').textContent); |
| idl_array.add_idls(document.querySelector('#tested').textContent); |
| idl_array.add_objects({ |
| CredentialsContainer: ['navigator.credentials'], |
| PasswordCredential: ['new PasswordCredential({ id: "id", password: "pencil", iconURL: "https://example.com/", name: "name" })'], |
| FederatedCredential: ['new FederatedCredential({ id: "id", provider: "https://example.com", iconURL: "https://example.com/", name: "name" })'] |
| }); |
| idl_array.test(); |
| </script> |
| |