Commit 1249d1b7 authored by msramek@chromium.org's avatar msramek@chromium.org

Remove the notifyFailedSignedIn callback from Blink.

As this is not a part of the specification https://w3c.github.io/webappsec/specs/credentialmanagement/#credentialcontainer

This patch is a part of a two-sided patchset:
Blink: https://codereview.chromium.org/1217463002/ <-- this patch
Chromium: https://codereview.chromium.org/1215653003/

BUG=494880

Review URL: https://codereview.chromium.org/1217463002

git-svn-id: svn://svn.chromium.org/blink/trunk@197981 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f446757b
<!DOCTYPE html>
<title>Credential Manager: notifyFailedSignIn() basics.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
function stubResolverChecker(c) {
assert_equals(c, undefined, "FIXME: We're currently always returning 'undefined'.");
this.done();
}
function stubRejectionChecker(reason) {
assert_unreached("notifyFailedSignIn() should not reject, but did: " + reason);
}
var local = new PasswordCredential('id', 'pencil', 'name', 'https://example.com/icon.png');
var federated = new FederatedCredential({
'id': 'id',
'provider': 'https://federation.test/',
'name': 'name',
'iconURL': 'https://example.test/icon.png'
});
async_test(function () {
navigator.credentials.notifyFailedSignIn().then(
this.step_func(function () { assert_unreached("notifyFailedSignIn() should reject."); }),
this.step_func(function (reason) {
assert_equals(reason.name, "TypeError");
this.done();
}));
}, "Verify the basics of notifyFailedSignIn(): PasswordCredential.");
async_test(function () {
navigator.credentials.notifyFailedSignIn(local).then(
this.step_func(stubResolverChecker.bind(this)),
this.step_func(stubRejectionChecker.bind(this)));
}, "Verify the basics of notifyFailedSignIn(): PasswordCredential.");
async_test(function () {
navigator.credentials.notifyFailedSignIn(federated).then(
this.step_func(stubResolverChecker.bind(this)),
this.step_func(stubRejectionChecker.bind(this)));
}, "Verify the basics of notifyFailedSignIn(): FederatedCredential.");
</script>
...@@ -27,7 +27,7 @@ async_test(function () { ...@@ -27,7 +27,7 @@ async_test(function () {
assert_equals(reason.name, "TypeError"); assert_equals(reason.name, "TypeError");
this.done(); this.done();
})); }));
}, "Verify the basics of notifyFailedSignIn(): PasswordCredential."); }, "Verify the basics of notifySignedIn(): PasswordCredential.");
async_test(function () { async_test(function () {
navigator.credentials.notifySignedIn("not a credential").then( navigator.credentials.notifySignedIn("not a credential").then(
...@@ -36,7 +36,7 @@ async_test(function () { ...@@ -36,7 +36,7 @@ async_test(function () {
assert_equals(reason.name, "TypeError"); assert_equals(reason.name, "TypeError");
this.done(); this.done();
})); }));
}, "Verify the basics of notifyFailedSignIn(): PasswordCredential."); }, "Verify the basics of notifySignedIn(): PasswordCredential.");
async_test(function () { async_test(function () {
navigator.credentials.notifySignedIn(local).then( navigator.credentials.notifySignedIn(local).then(
......
...@@ -625,7 +625,6 @@ interface Credential ...@@ -625,7 +625,6 @@ interface Credential
method constructor method constructor
interface CredentialsContainer interface CredentialsContainer
method constructor method constructor
method notifyFailedSignIn
method notifySignedIn method notifySignedIn
method request method request
method requireUserMediation method requireUserMediation
......
...@@ -635,7 +635,6 @@ interface Credential ...@@ -635,7 +635,6 @@ interface Credential
method constructor method constructor
interface CredentialsContainer interface CredentialsContainer
method constructor method constructor
method notifyFailedSignIn
method notifySignedIn method notifySignedIn
method request method request
method requireUserMediation method requireUserMediation
......
...@@ -147,17 +147,6 @@ ScriptPromise CredentialsContainer::notifySignedIn(ScriptState* scriptState, Cre ...@@ -147,17 +147,6 @@ ScriptPromise CredentialsContainer::notifySignedIn(ScriptState* scriptState, Cre
return promise; return promise;
} }
ScriptPromise CredentialsContainer::notifyFailedSignIn(ScriptState* scriptState, Credential* credential)
{
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
if (!checkBoilerplate(resolver))
return promise;
CredentialManagerClient::from(scriptState->executionContext())->dispatchFailedSignIn(WebCredential::create(credential->platformCredential()), new NotificationCallbacks(resolver));
return promise;
}
ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptState) ScriptPromise CredentialsContainer::requireUserMediation(ScriptState* scriptState)
{ {
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState); RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
......
...@@ -24,7 +24,6 @@ public: ...@@ -24,7 +24,6 @@ public:
// CredentialsContainer.h // CredentialsContainer.h
ScriptPromise request(ScriptState*, const CredentialRequestOptions&); ScriptPromise request(ScriptState*, const CredentialRequestOptions&);
ScriptPromise notifySignedIn(ScriptState*, Credential* = 0); ScriptPromise notifySignedIn(ScriptState*, Credential* = 0);
ScriptPromise notifyFailedSignIn(ScriptState*, Credential* = 0);
ScriptPromise requireUserMediation(ScriptState*); ScriptPromise requireUserMediation(ScriptState*);
DEFINE_INLINE_VIRTUAL_TRACE() { } DEFINE_INLINE_VIRTUAL_TRACE() { }
......
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
] interface CredentialsContainer { ] interface CredentialsContainer {
[CallWith=ScriptState] Promise request(optional CredentialRequestOptions options); [CallWith=ScriptState] Promise request(optional CredentialRequestOptions options);
[CallWith=ScriptState, TypeChecking=Interface] Promise notifySignedIn(Credential credential); [CallWith=ScriptState, TypeChecking=Interface] Promise notifySignedIn(Credential credential);
[CallWith=ScriptState, TypeChecking=Interface] Promise notifyFailedSignIn(Credential credential);
[CallWith=ScriptState] Promise requireUserMediation(); [CallWith=ScriptState] Promise requireUserMediation();
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment