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

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

Issue 661973002: Credential Manager: JavaScript arguments make more sense in a different order. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
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', 'name', 'https://example.com/avat ar.png', 'pencil'); 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_equals(credential.id, 'id'); 17 assert_equals(credential.id, 'id');
18 assert_equals(credential.name, 'name'); 18 assert_equals(credential.name, 'name');
19 assert_equals(credential.avatarURL, 'https://example.com/avatar.png'); 19 assert_equals(credential.avatarURL, 'https://example.com/avatar.png');
20 assert_equals(credential.password, 'pencil'); 20 assert_equals(credential.password, 'pencil');
21 }, 'Interfaces and attributes of LocalCredential'); 21 }, 'Interfaces and attributes of LocalCredential');
22 22
23 test(function() { 23 test(function() {
24 assert_throws(new SyntaxError(), function () { 24 assert_throws(new SyntaxError(), function () {
25 var credential = new LocalCredential('id', 'name', '-', 'pencil'); 25 var credential = new LocalCredential('id', 'pencil', 'name', '-');
26 }); 26 });
27 }, 'Construct a LocalCredential with an invalid avatar URL.'); 27 }, 'Construct a LocalCredential with an invalid avatar URL.');
28 28
29 test(function() { 29 test(function() {
30 var credential = new LocalCredential('id', 'name', '', 'pencil'); 30 var credential = new LocalCredential('id', 'pencil', 'name');
31 31
32 assert_equals(credential.id, 'id'); 32 assert_equals(credential.id, 'id');
33 assert_equals(credential.name, 'name'); 33 assert_equals(credential.name, 'name');
34 assert_equals(credential.avatarURL, ''); 34 assert_equals(credential.avatarURL, '');
35 assert_equals(credential.password, 'pencil'); 35 assert_equals(credential.password, 'pencil');
36 36
37 }, 'Construct a LocalCredential with an empty avatar URL.'); 37 }, 'Construct a LocalCredential with an empty avatar URL.');
38
39 test(function() {
40 var credential = new LocalCredential('id', 'pencil');
41
42 assert_equals(credential.id, 'id');
43 assert_equals(credential.name, '');
44 assert_equals(credential.avatarURL, '');
45 assert_equals(credential.password, 'pencil');
46
47 }, 'Construct a LocalCredential with an empty namd and avatar URL.');
38 </script> 48 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698