Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / credentialmanager / credentialscontainer-notifyfailedsignin-basics.html
1 <!DOCTYPE html>
2 <title>Credential Manager: notifyFailedSignIn() basics.</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script>
6 function stubResolverChecker(c) {
7     assert_equals(c, undefined, "FIXME: We're currently always returning 'undefined'.");
8     this.done();
9 }
10
11 function stubRejectionChecker(reason) {
12     assert_unreached("notifyFailedSignIn() should not reject, but did: " + reason.name);
13 }
14
15 var local = new LocalCredential('id', 'name', 'https://example.com/avatar.png', 'pencil');
16 var federated = new FederatedCredential('id', 'name', 'https://example.com/avatar.png', 'https://federation.net');
17
18 async_test(function () {
19     navigator.credentials.notifyFailedSignIn(local).then(
20         this.step_func(stubResolverChecker.bind(this)),
21         this.step_func(stubRejectionChecker.bind(this)));
22 }, "Verify the basics of notifyFailedSignIn(): LocalCredential.");
23
24 async_test(function () {
25     navigator.credentials.notifyFailedSignIn(federated).then(
26         this.step_func(stubResolverChecker.bind(this)),
27         this.step_func(stubRejectionChecker.bind(this)));
28 }, "Verify the basics of notifyFailedSignIn(): FederatedCredential.");
29 </script>