Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: LayoutTests/http/tests/credentialmanager/localcredential-basics.html

Issue 645023005: Credential Manager: Add a 'formData' property to LocalCredential. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/reordering-arguments
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Credential Manager: LocalCredential basics.</title> 2 <title>Credential Manager: LocalCredential 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 test(function() { 7 test(function() {
8 var credential = new LocalCredential('id', 'pencil', 'name', 'https://exampl e.com/avatar.png'); 8 var credential = new LocalCredential('id', 'pencil', 'name', 'https://exampl e.com/avatar.png');
9 9
10 verifyInterface('LocalCredential', credential, { 10 verifyInterface('LocalCredential', credential, {
11 id: 'string', 11 id: 'string',
12 name: 'string', 12 name: 'string',
13 avatarURL: 'string', 13 avatarURL: 'string',
14 password: 'string' 14 password: 'string'
15 }); 15 });
16 16
17 assert_true(credential.formData instanceof FormData);
sof 2014/10/20 08:35:46 Can't you test this via the other typechecks in ve
Mike West 2014/10/20 09:47:38 Sure. I was originally intending to check the valu
18
17 assert_equals(credential.id, 'id'); 19 assert_equals(credential.id, 'id');
18 assert_equals(credential.name, 'name'); 20 assert_equals(credential.name, 'name');
19 assert_equals(credential.avatarURL, 'https://example.com/avatar.png'); 21 assert_equals(credential.avatarURL, 'https://example.com/avatar.png');
20 assert_equals(credential.password, 'pencil'); 22 assert_equals(credential.password, 'pencil');
21 }, 'Interfaces and attributes of LocalCredential'); 23 }, 'Interfaces and attributes of LocalCredential');
22 24
23 test(function() { 25 test(function() {
24 assert_throws(new SyntaxError(), function () { 26 assert_throws(new SyntaxError(), function () {
25 var credential = new LocalCredential('id', 'pencil', 'name', '-'); 27 var credential = new LocalCredential('id', 'pencil', 'name', '-');
26 }); 28 });
27 }, 'Construct a LocalCredential with an invalid avatar URL.'); 29 }, 'Construct a LocalCredential with an invalid avatar URL.');
28 30
29 test(function() { 31 test(function() {
30 var credential = new LocalCredential('id', 'pencil', 'name'); 32 var credential = new LocalCredential('id', 'pencil', 'name');
31 33
34 assert_true(credential.formData instanceof FormData);
35
32 assert_equals(credential.id, 'id'); 36 assert_equals(credential.id, 'id');
33 assert_equals(credential.name, 'name'); 37 assert_equals(credential.name, 'name');
34 assert_equals(credential.avatarURL, ''); 38 assert_equals(credential.avatarURL, '');
35 assert_equals(credential.password, 'pencil'); 39 assert_equals(credential.password, 'pencil');
36 40
37 }, 'Construct a LocalCredential with an empty avatar URL.'); 41 }, 'Construct a LocalCredential with an empty avatar URL.');
38 42
39 test(function() { 43 test(function() {
40 var credential = new LocalCredential('id', 'pencil'); 44 var credential = new LocalCredential('id', 'pencil');
41 45
46 assert_true(credential.formData instanceof FormData);
47
42 assert_equals(credential.id, 'id'); 48 assert_equals(credential.id, 'id');
43 assert_equals(credential.name, ''); 49 assert_equals(credential.name, '');
44 assert_equals(credential.avatarURL, ''); 50 assert_equals(credential.avatarURL, '');
45 assert_equals(credential.password, 'pencil'); 51 assert_equals(credential.password, 'pencil');
46 52
47 }, 'Construct a LocalCredential with an empty namd and avatar URL.'); 53 }, 'Construct a LocalCredential with an empty namd and avatar URL.');
48 </script> 54 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/modules/credentialmanager/Credential.h » ('j') | Source/modules/credentialmanager/Credential.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698