Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[CredentialManagement] Add IDL definitions for Credential, SiteBoundC…
…redential, and PasswordCredential

https://bugs.webkit.org/show_bug.cgi?id=168616
<rdar://problem/30167149>

Reviewed by Daniel Bates.

Source/WebCore:

This patch adds IDL definitions for:
1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).

Test: credentials/idlharness.html

* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentials/BasicCredential.cpp: Added.
(WebCore::BasicCredential::BasicCredential):
(WebCore::BasicCredential::~BasicCredential):
(WebCore::BasicCredential::type):
* Modules/credentials/BasicCredential.h: Added.
(WebCore::BasicCredential::id):
* Modules/credentials/BasicCredential.idl: Added.
* Modules/credentials/CredentialData.h: Added.
* Modules/credentials/CredentialData.idl: Added.
* Modules/credentials/PasswordCredential.cpp: Added.
(WebCore::PasswordCredential::PasswordCredential):
(WebCore::PasswordCredential::PasswordCredential):
Dummy constructors for now.
* Modules/credentials/PasswordCredential.h: Added.
(WebCore::PasswordCredential::create):
(WebCore::PasswordCredential::create):
(WebCore::PasswordCredential::setIdName):
(WebCore::PasswordCredential::idName):
(WebCore::PasswordCredential::setPasswordName):
(WebCore::PasswordCredential::passwordName):
(WebCore::PasswordCredential::setAdditionalData):
(WebCore::PasswordCredential::additionalData):
* Modules/credentials/PasswordCredential.idl: Added.
* Modules/credentials/SiteBoundCredential.cpp: Added.
(WebCore::SiteBoundCredential::SiteBoundCredential):
(WebCore::SiteBoundCredential::~SiteBoundCredential):
* Modules/credentials/SiteBoundCredential.h: Added.
(WebCore::SiteBoundCredential::name):
(WebCore::SiteBoundCredential::iconURL):
(WebCore::SiteBoundCredential::setOrigin):
(WebCore::SiteBoundCredential::origin):
* Modules/credentials/SiteBoundCredential.idl: Added.
* Modules/credentials/SiteBoundCredentialData.h: Added.
* Modules/credentials/SiteBoundCredentialData.idl: Added.
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* credentials/idlharness-expected.txt: Added.
* credentials/idlharness.html: Added.
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* resources/WebIDLParser.js: Added.
* resources/idlharness.js: Renamed from LayoutTests/imported/w3c/resources/idlharness.js.
Removed LayoutTests/imported/w3c/resources/idlharness.js since it is not needed any more.
Added resources/idlharness.js for idl harness.


Canonical link: https://commits.webkit.org/185913@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Jiewen Tan committed Feb 27, 2017
1 parent f058561 commit a95761f
Show file tree
Hide file tree
Showing 26 changed files with 2,057 additions and 24 deletions.
19 changes: 19 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
2017-02-27 Jiewen Tan <jiewen_tan@apple.com>

[CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
https://bugs.webkit.org/show_bug.cgi?id=168616
<rdar://problem/30167149>

Reviewed by Daniel Bates.

* credentials/idlharness-expected.txt: Added.
* credentials/idlharness.html: Added.
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* resources/WebIDLParser.js: Added.
* resources/idlharness.js: Renamed from LayoutTests/imported/w3c/resources/idlharness.js.
Removed LayoutTests/imported/w3c/resources/idlharness.js since it is not needed any more.
Added resources/idlharness.js for idl harness.

2017-02-27 Jer Noble <jer.noble@apple.com>

[WebRTC] Fix remote audio rendering
Expand Down
37 changes: 37 additions & 0 deletions LayoutTests/credentials/idlharness-expected.txt
@@ -0,0 +1,37 @@
idlharness test

This test validates the WebIDL included in the Credential Management API.


PASS Credential interface: existence and properties of interface object
PASS Credential interface object length
PASS Credential interface object name
PASS Credential interface: existence and properties of interface prototype object
PASS Credential interface: existence and properties of interface prototype object's "constructor" property
PASS Credential interface: attribute id
PASS Credential interface: attribute type
PASS SiteBoundCredential interface: existence and properties of interface object
PASS SiteBoundCredential interface object length
PASS SiteBoundCredential interface object name
PASS SiteBoundCredential interface: existence and properties of interface prototype object
PASS SiteBoundCredential interface: existence and properties of interface prototype object's "constructor" property
PASS SiteBoundCredential interface: attribute name
PASS SiteBoundCredential interface: attribute iconURL
PASS PasswordCredential interface: existence and properties of interface object
PASS PasswordCredential interface object length
PASS PasswordCredential interface object name
PASS PasswordCredential interface: existence and properties of interface prototype object
PASS PasswordCredential interface: existence and properties of interface prototype object's "constructor" property
PASS PasswordCredential interface: attribute idName
PASS PasswordCredential interface: attribute passwordName
PASS PasswordCredential interface: attribute additionalData
PASS PasswordCredential must be primary interface of new PasswordCredential({ password: "12345", id: "12345" })
PASS Stringification of new PasswordCredential({ password: "12345", id: "12345" })
PASS PasswordCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "idName" with the proper type (0)
PASS PasswordCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "passwordName" with the proper type (1)
PASS PasswordCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "additionalData" with the proper type (2)
PASS SiteBoundCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "name" with the proper type (0)
PASS SiteBoundCredential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "iconURL" with the proper type (1)
PASS Credential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "id" with the proper type (0)
PASS Credential interface: new PasswordCredential({ password: "12345", id: "12345" }) must inherit property "type" with the proper type (1)

76 changes: 76 additions & 0 deletions LayoutTests/credentials/idlharness.html
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../resources/WebIDLParser.js"></script>
<script src="../resources/idlharness.js"></script>

<h1>idlharness test</h1>
<p>This test validates the WebIDL included in the Credential Management API.</p>

<script type="text/plain" class="untested-idl">
interface Window {};
</script>

<script type="text/plain" class="idl">
// 3.1.1 Credential

dictionary CredentialData {
required USVString id;
};

[SecureContext] interface Credential {
readonly attribute USVString id;
readonly attribute DOMString type;
};

// No Transferable at this moment
// Credential implements Transferable;

dictionary SiteBoundCredentialData : CredentialData {
USVString name;
USVString iconURL;
};

[SecureContext] interface SiteBoundCredential : Credential {
readonly attribute USVString name;
readonly attribute USVString iconURL;
};

// 3.1.3 PasswordCredential

dictionary PasswordCredentialData : SiteBoundCredentialData {
required USVString password;
};

typedef (FormData or URLSearchParams) CredentialBodyType;

[Constructor(PasswordCredentialData data),
Constructor(HTMLFormElement form),
Exposed=Window,
SecureContext]
interface PasswordCredential : SiteBoundCredential {
attribute USVString idName;
attribute USVString passwordName;

attribute CredentialBodyType? additionalData;
};

</script>

<script>
function select(selector) {
return [].slice.call(document.querySelectorAll(selector))
.map(function(e) { return e.textContent; })
.join('\n\n');
}

var idl = select('.idl')
var untested = select('.untested-idl');
var idl_array = new IdlArray();
idl_array.add_untested_idls(untested);
idl_array.add_idls(idl);
idl_array.add_objects({
PasswordCredential: ['new PasswordCredential({ password: "12345", id: "12345" })'],
});
idl_array.test();
</script>
Expand Up @@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
Expand Down Expand Up @@ -1163,6 +1168,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
Expand Down Expand Up @@ -2093,6 +2103,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
Expand Down
Expand Up @@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
Expand Down Expand Up @@ -1163,6 +1168,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
Expand Down Expand Up @@ -2093,6 +2103,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
Expand Down
Expand Up @@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
Expand Down Expand Up @@ -1158,6 +1163,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
Expand Down Expand Up @@ -2088,6 +2098,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
Expand Down
Expand Up @@ -303,6 +303,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('get') is
PASS Object.getOwnPropertyDescriptor(global, 'Counter').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Counter').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Credential').value is Credential
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'Credential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').value is Crypto
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Crypto').hasOwnProperty('set') is false
Expand Down Expand Up @@ -1168,6 +1173,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProper
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PageTransitionEvent').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').value is PasswordCredential
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'PasswordCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').value is Path2D
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'Path2D').hasOwnProperty('set') is false
Expand Down Expand Up @@ -2098,6 +2108,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SharedArrayBuffer').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').value is SiteBoundCredential
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').hasOwnProperty('set') is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').enumerable is false
PASS Object.getOwnPropertyDescriptor(global, 'SiteBoundCredential').configurable is true
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').value is SourceBuffer
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('get') is false
PASS Object.getOwnPropertyDescriptor(global, 'SourceBuffer').hasOwnProperty('set') is false
Expand Down

0 comments on commit a95761f

Please sign in to comment.