| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Credential Manager: get() basics.</title> | 2 <title>Credential Manager: get() basics.</title> |
| 3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="/serviceworker/resources/interfaces.js"></script> | 5 <script src="/serviceworker/resources/interfaces.js"></script> |
| 6 <script> | 6 <script> |
| 7 function stubResolverUndefinedChecker(c) { | 7 function stubResolverUndefinedChecker(c) { |
| 8 assert_equals(c, undefined); | 8 assert_equals(c, undefined); |
| 9 this.done(); | 9 this.done(); |
| 10 } | 10 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 function stubResolverChecker(c) { | 85 function stubResolverChecker(c) { |
| 86 verify_interface('PasswordCredential', c, { | 86 verify_interface('PasswordCredential', c, { |
| 87 id: 'string', | 87 id: 'string', |
| 88 name: 'string', | 88 name: 'string', |
| 89 iconURL: 'string' | 89 iconURL: 'string' |
| 90 }); | 90 }); |
| 91 | 91 |
| 92 assert_equals(c.id, id); | 92 assert_equals(c.id, id); |
| 93 assert_equals(c.name, name); | 93 assert_equals(c.name, name); |
| 94 assert_equals(c.iconURL, icon); | 94 assert_equals(c.iconURL, icon); |
| 95 assert_true(c.toFormData() instanceof FormData); | 95 assert_equals(c.idName, 'username'); |
| 96 assert_equals(c.passwordName, 'password'); |
| 97 assert_equals(c.additionalData, null); |
| 96 | 98 |
| 97 this.done(); | 99 this.done(); |
| 98 } | 100 } |
| 99 | 101 |
| 100 var t = async_test("Verify that the mock returns the values we give it."); | 102 var t = async_test("Verify that the mock returns the values we give it."); |
| 101 t.step(function() { | 103 t.step(function() { |
| 102 if (window.testRunner) | 104 if (window.testRunner) |
| 103 testRunner.addMockCredentialManagerResponse(id, name, icon, password
); | 105 testRunner.addMockCredentialManagerResponse(id, name, icon, password
); |
| 104 navigator.credentials.get().then( | 106 navigator.credentials.get().then( |
| 105 t.step_func(stubResolverChecker.bind(t)), | 107 t.step_func(stubResolverChecker.bind(t)), |
| 106 t.step_func(stubRejectionChecker.bind(t))); | 108 t.step_func(stubRejectionChecker.bind(t))); |
| 107 }); | 109 }); |
| 108 }()); | 110 }()); |
| 109 </script> | 111 </script> |
| OLD | NEW |