Title: [226001] trunk/LayoutTests/imported/w3c
Revision
226001
Author
jiewen_...@apple.com
Date
2017-12-16 10:31:42 -0800 (Sat, 16 Dec 2017)

Log Message

[CredentialManagement] Import Credential Management Web Platform Tests
https://bugs.webkit.org/show_bug.cgi?id=172015
<rdar://problem/36083577>

Reviewed by Youenn Fablet.

* resources/import-expectations.json:
* web-platform-tests/credential-management/credentialscontainer-create-basics.https-expected.txt: Added.
* web-platform-tests/credential-management/credentialscontainer-create-basics.https.html: Added.
* web-platform-tests/credential-management/idl.https-expected.txt: Added.
* web-platform-tests/credential-management/idl.https.html: Added.
* web-platform-tests/credential-management/w3c-import.log: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (226000 => 226001)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-12-16 18:20:04 UTC (rev 226000)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-12-16 18:31:42 UTC (rev 226001)
@@ -1,3 +1,18 @@
+2017-12-16  Jiewen Tan  <jiewen_...@apple.com>
+
+        [CredentialManagement] Import Credential Management Web Platform Tests
+        https://bugs.webkit.org/show_bug.cgi?id=172015
+        <rdar://problem/36083577>
+
+        Reviewed by Youenn Fablet.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/credential-management/credentialscontainer-create-basics.https-expected.txt: Added.
+        * web-platform-tests/credential-management/credentialscontainer-create-basics.https.html: Added.
+        * web-platform-tests/credential-management/idl.https-expected.txt: Added.
+        * web-platform-tests/credential-management/idl.https.html: Added.
+        * web-platform-tests/credential-management/w3c-import.log: Added.
+
 2017-12-16  Chris Dumez  <cdu...@apple.com>
 
         Add optimization when updating a SW registration results in the exact same script

Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (226000 => 226001)


--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2017-12-16 18:20:04 UTC (rev 226000)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json	2017-12-16 18:31:42 UTC (rev 226001)
@@ -45,7 +45,7 @@
     "web-platform-tests/cookies": "skip", 
     "web-platform-tests/core-aam": "skip", 
     "web-platform-tests/cors": "import", 
-    "web-platform-tests/credential-management": "skip", 
+    "web-platform-tests/credential-management": "import", 
     "web-platform-tests/css": "skip", 
     "web-platform-tests/css-backgrounds": "skip", 
     "web-platform-tests/css-cascade": "skip", 

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/credentialscontainer-create-basics.https-expected.txt (0 => 226001)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/credentialscontainer-create-basics.https-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/credentialscontainer-create-basics.https-expected.txt	2017-12-16 18:31:42 UTC (rev 226001)
@@ -0,0 +1,17 @@
+
+FAIL navigator.credentials.create() with no argument. undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with empty argument. undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with valid PasswordCredentialData undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with valid HTMLFormElement undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus password data undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with valid FederatedCredentialData undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus federated data undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus publicKey data undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() returns PublicKeyCredential undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with both PasswordCredentialData and FederatedCredentialData undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus password and federated data undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus federated and publicKey data undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus password and publicKey data undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus password, federated, and publicKey data undefined is not an object (evaluating 'navigator.credentials.create')
+FAIL navigator.credentials.create() with bogus data undefined is not an object (evaluating 'navigator.credentials.create')
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/credentialscontainer-create-basics.https.html (0 => 226001)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/credentialscontainer-create-basics.https.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/credentialscontainer-create-basics.https.html	2017-12-16 18:31:42 UTC (rev 226001)
@@ -0,0 +1,164 @@
+<!DOCTYPE html>
+<title>Credential Management API: create() basics.</title>
+<script src=""
+<script src=""
+<script>
+promise_test(function(t) {
+    return promise_rejects(t, "NotSupportedError",
+            navigator.credentials.create());
+}, "navigator.credentials.create() with no argument.");
+
+promise_test(function(t) {
+    return promise_rejects(t, "NotSupportedError",
+            navigator.credentials.create({}));
+}, "navigator.credentials.create() with empty argument.");
+
+promise_test(function(t) {
+    var credential_data = {
+        id: 'id',
+        password: 'pencil',
+    };
+
+    return navigator.credentials.create({password: credential_data})
+        .then(function(credential) {
+            assert_equals(credential.id, 'id');
+            assert_equals(credential.name, '');
+            assert_equals(credential.iconURL, '');
+            assert_equals(credential.type, 'password');
+            assert_equals(credential.password, 'pencil');
+        });
+}, "navigator.credentials.create() with valid PasswordCredentialData");
+
+promise_test(function(t) {
+    var f = document.createElement('form');
+    f.innerHTML = "<input type='text' name='theId' value='musterman' autocomplete='username'>"
+        + "<input type='text' name='thePassword' value='sekrit' autocomplete='current-password'>"
+        + "<input type='text' name='theIcon' value='https://example.com/photo' autocomplete='photo'>"
+        + "<input type='text' name='theExtraField' value='extra'>"
+        + "<input type='text' name='theName' value='friendly name' autocomplete='name'>";
+
+    return navigator.credentials.create({password: f})
+        .then(function(credential) {
+            assert_equals(credential.id, 'musterman');
+            assert_equals(credential.name, 'friendly name');
+            assert_equals(credential.iconURL, 'https://example.com/photo');
+            assert_equals(credential.type, 'password');
+            assert_equals(credential.password, 'sekrit');
+        });
+}, "navigator.credentials.create() with valid HTMLFormElement");
+
+promise_test(function(t) {
+    return promise_rejects(t, new TypeError(),
+            navigator.credentials.create({password: "bogus password data"}));
+}, "navigator.credentials.create() with bogus password data");
+
+promise_test(function(t) {
+    var federated_data = {
+        id: 'id',
+        provider: 'https://example.com/',
+    };
+
+    return navigator.credentials.create({federated: federated_data})
+        .then(function(credential) {
+            assert_equals(credential.id, 'id');
+            assert_equals(credential.name, '');
+            assert_equals(credential.iconURL, '');
+            assert_equals(credential.type, 'federated');
+        });
+}, "navigator.credentials.create() with valid FederatedCredentialData");
+
+promise_test(function(t) {
+    return promise_rejects(t, new TypeError(),
+            navigator.credentials.create({federated: "bogus federated data"}));
+}, "navigator.credentials.create() with bogus federated data");
+
+promise_test(function(t) {
+    return promise_rejects(t, new TypeError(),
+            navigator.credentials.create({publicKey: "bogus publicKey data"}));
+}, "navigator.credentials.create() with bogus publicKey data");
+
+promise_test(function(t) {
+    var publicKey = {
+        challenge: new TextEncoder().encode("climb a mountain"),
+        rp: {
+            id: "1098237235409872",
+            name: "Acme"
+        },
+
+        user: {
+            id: "1098237235409872",
+            name: "avery.a.jo...@example.com",
+            displayName: "Avery A. Jones",
+            icon: "https://pics.acme.com/00/p/aBjjjpqPb.png"
+        },
+
+        parameters: [{
+            type: "public-key",
+            algorithm: "ES256",
+        },],
+
+        timeout: 60000,  // 1 minute
+        excludeList: [], // No excludeList
+    };
+
+    return navigator.credentials.create({publicKey}).then(r => {
+    assert_true(r instanceof PublicKeyCredential);
+    });
+}, "navigator.credentials.create() returns PublicKeyCredential");
+
+promise_test(function(t) {
+    var credential_data = {
+        id: 'id',
+        password: 'pencil',
+    };
+
+    var federated_data = {
+        id: 'id',
+        provider: 'https://example.com/',
+    };
+
+    return promise_rejects(t, "NotSupportedError",
+            navigator.credentials.create({
+                password: credential_data,
+                federated: federated_data,
+            }));
+}, "navigator.credentials.create() with both PasswordCredentialData and FederatedCredentialData");
+
+promise_test(function(t) {
+    return promise_rejects(t, new TypeError(),
+            navigator.credentials.create({
+                password: "bogus password data",
+                federated: "bogus federated data",
+            }));
+}, "navigator.credentials.create() with bogus password and federated data");
+
+promise_test(function(t) {
+    return promise_rejects(t, new TypeError(),
+            navigator.credentials.create({
+                federated: "bogus federated data",
+                publicKey: "bogus publicKey data",
+            }));
+}, "navigator.credentials.create() with bogus federated and publicKey data");
+
+promise_test(function(t) {
+    return promise_rejects(t, new TypeError(),
+            navigator.credentials.create({
+                password: "bogus password data",
+                publicKey: "bogus publicKey data",
+            }));
+}, "navigator.credentials.create() with bogus password and publicKey data");
+
+promise_test(function(t) {
+    return promise_rejects(t, new TypeError(),
+            navigator.credentials.create({
+                password: "bogus password data",
+                federated: "bogus federated data",
+                publicKey: "bogus publicKey data",
+            }));
+}, "navigator.credentials.create() with bogus password, federated, and publicKey data");
+
+promise_test(function(t) {
+    return promise_rejects(t, "NotSupportedError",
+            navigator.credentials.create({bogus_key: "bogus data"}));
+}, "navigator.credentials.create() with bogus data");
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/idl.https-expected.txt (0 => 226001)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/idl.https-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/idl.https-expected.txt	2017-12-16 18:31:42 UTC (rev 226001)
@@ -0,0 +1,40 @@
+
+FAIL CredentialsContainer interface: existence and properties of interface object assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface object length assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface object name assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface: operation get(CredentialRequestOptions) assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface: operation store(Credential) assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface: operation create(CredentialCreationOptions) assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer interface: operation preventSilentAccess() assert_own_property: self does not have own property "CredentialsContainer" expected property "CredentialsContainer" missing
+FAIL CredentialsContainer must be primary interface of navigator.credentials assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL Stringification of navigator.credentials assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL CredentialsContainer interface: navigator.credentials must inherit property "get(CredentialRequestOptions)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL CredentialsContainer interface: calling get(CredentialRequestOptions) on navigator.credentials with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL CredentialsContainer interface: navigator.credentials must inherit property "store(Credential)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL CredentialsContainer interface: calling store(Credential) on navigator.credentials with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL CredentialsContainer interface: navigator.credentials must inherit property "create(CredentialCreationOptions)" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL CredentialsContainer interface: calling create(CredentialCreationOptions) on navigator.credentials with too few arguments must throw TypeError assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL CredentialsContainer interface: navigator.credentials must inherit property "preventSilentAccess()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined"
+FAIL PasswordCredential interface: existence and properties of interface object assert_own_property: self does not have own property "PasswordCredential" expected property "PasswordCredential" missing
+FAIL PasswordCredential interface object length assert_own_property: self does not have own property "PasswordCredential" expected property "PasswordCredential" missing
+FAIL PasswordCredential interface object name assert_own_property: self does not have own property "PasswordCredential" expected property "PasswordCredential" missing
+FAIL PasswordCredential interface: existence and properties of interface prototype object assert_own_property: self does not have own property "PasswordCredential" expected property "PasswordCredential" missing
+FAIL PasswordCredential interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "PasswordCredential" expected property "PasswordCredential" missing
+FAIL PasswordCredential interface: attribute password assert_own_property: self does not have own property "PasswordCredential" expected property "PasswordCredential" missing
+FAIL PasswordCredential must be primary interface of new PasswordCredential({ id: "id", password: "pencil", iconURL: "https://example.com/", name: "name" }) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: PasswordCredential"
+FAIL Stringification of new PasswordCredential({ id: "id", password: "pencil", iconURL: "https://example.com/", name: "name" }) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: PasswordCredential"
+FAIL PasswordCredential interface: new PasswordCredential({ id: "id", password: "pencil", iconURL: "https://example.com/", name: "name" }) must inherit property "password" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: PasswordCredential"
+FAIL FederatedCredential interface: existence and properties of interface object assert_own_property: self does not have own property "FederatedCredential" expected property "FederatedCredential" missing
+FAIL FederatedCredential interface object length assert_own_property: self does not have own property "FederatedCredential" expected property "FederatedCredential" missing
+FAIL FederatedCredential interface object name assert_own_property: self does not have own property "FederatedCredential" expected property "FederatedCredential" missing
+FAIL FederatedCredential interface: existence and properties of interface prototype object assert_own_property: self does not have own property "FederatedCredential" expected property "FederatedCredential" missing
+FAIL FederatedCredential interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "FederatedCredential" expected property "FederatedCredential" missing
+FAIL FederatedCredential interface: attribute provider assert_own_property: self does not have own property "FederatedCredential" expected property "FederatedCredential" missing
+FAIL FederatedCredential interface: attribute protocol assert_own_property: self does not have own property "FederatedCredential" expected property "FederatedCredential" missing
+FAIL FederatedCredential must be primary interface of new FederatedCredential({ id: "id", provider: "https://example.com", iconURL: "https://example.com/", name: "name" }) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: FederatedCredential"
+FAIL Stringification of new FederatedCredential({ id: "id", provider: "https://example.com", iconURL: "https://example.com/", name: "name" }) assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: FederatedCredential"
+FAIL FederatedCredential interface: new FederatedCredential({ id: "id", provider: "https://example.com", iconURL: "https://example.com/", name: "name" }) must inherit property "provider" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: FederatedCredential"
+FAIL FederatedCredential interface: new FederatedCredential({ id: "id", provider: "https://example.com", iconURL: "https://example.com/", name: "name" }) must inherit property "protocol" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: Can't find variable: FederatedCredential"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/idl.https.html (0 => 226001)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/idl.https.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/idl.https.html	2017-12-16 18:31:42 UTC (rev 226001)
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+<script type="text/plain" id="untested">
+    dictionary CredentialData {
+      USVString id;
+    };
+
+    [Exposed=Window, SecureContext]
+    interface Credential {
+      readonly attribute USVString id;
+      readonly attribute DOMString type;
+    };
+
+    [NoInterfaceObject, SecureContext]
+    interface CredentialUserData {
+      readonly attribute USVString name;
+      readonly attribute USVString iconURL;
+    };
+
+    dictionary PasswordCredentialData : CredentialData {
+      USVString name;
+      USVString iconURL;
+      required USVString password;
+    };
+
+    typedef (PasswordCredentialData or HTMLFormElement) PasswordCredentialInit;
+
+    typedef (FormData or URLSearchParams) CredentialBodyType;
+
+
+    dictionary FederatedCredentialInit : CredentialData {
+      USVString name;
+      USVString iconURL;
+      required USVString provider;
+      DOMString protocol;
+    };
+
+    dictionary CredentialCreationOptions {
+      PasswordCredentialInit? password;
+      FederatedCredentialInit? federated;
+    };
+
+    enum CredentialMediationRequirement {
+      "silent",
+      "optional",
+      "required"
+    };
+
+    dictionary CredentialRequestOptions {
+      boolean password = false;
+      FederatedCredentialRequestOptions federated;
+
+      CredentialMediationRequirement mediation = "optional";
+    };
+
+    dictionary FederatedCredentialRequestOptions {
+      sequence<USVString> providers;
+      sequence<DOMString> protocols;
+    };
+
+</script>
+<script type="text/plain" id="tested">
+    [Exposed=Window, SecureContext]
+    interface CredentialsContainer {
+      Promise<Credential> get(optional CredentialRequestOptions options);
+      Promise<Credential> store(Credential credential);
+      Promise<Credential?> create(optional CredentialCreationOptions options);
+      Promise<void> preventSilentAccess();
+    };
+
+    [Constructor(PasswordCredentialData data),
+     Constructor(HTMLFormElement form),
+     Exposed=Window,
+     SecureContext]
+    interface PasswordCredential : Credential {
+      readonly attribute DOMString password;
+    };
+    PasswordCredential implements CredentialUserData;
+
+    [Constructor(FederatedCredentialInit data),
+     Exposed=Window,
+     SecureContext]
+    interface FederatedCredential : Credential {
+      readonly attribute USVString provider;
+      readonly attribute DOMString? protocol;
+    };
+    FederatedCredential implements CredentialUserData;
+</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>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/w3c-import.log (0 => 226001)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/w3c-import.log	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/credential-management/w3c-import.log	2017-12-16 18:31:42 UTC (rev 226001)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+	https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/credential-management/credentialscontainer-create-basics.https.html
+/LayoutTests/imported/w3c/web-platform-tests/credential-management/idl.https.html
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to