2 <title>Credential Manager: FederatedCredential basics.
</title>
3 <script src=
"../resources/testharness.js"></script>
4 <script src=
"../resources/testharnessreport.js"></script>
5 <script src=
"/serviceworker/resources/interfaces.js"></script>
8 var credential
= new FederatedCredential({
10 'provider': 'https://federation.test/',
12 'iconURL': 'https://example.test/icon.png'
15 assert_true(credential
instanceof Credential
);
16 assert_true(credential
instanceof FederatedCredential
);
18 verify_interface('FederatedCredential', credential
, {
26 assert_equals(credential
.id
, 'id');
27 assert_equals(credential
.name
, 'name');
28 assert_equals(credential
.iconURL
, 'https://example.test/icon.png');
29 assert_equals(credential
.provider
, 'https://federation.test/');
30 assert_equals(credential
.type
, 'federated');
31 }, 'Interfaces and attributes of FederatedCredential');
34 var credential
= new FederatedCredential({
36 'provider': 'https://federation.test/',
40 assert_equals(credential
.id
, 'id');
41 assert_equals(credential
.name
, 'name');
42 assert_equals(credential
.iconURL
, '');
43 assert_equals(credential
.provider
, 'https://federation.test/');
44 assert_equals(credential
.type
, 'federated');
45 }, 'Interfaces and attributes of FederatedCredential');
48 var credential
= new FederatedCredential({
50 'provider': 'https://federation.test/',
53 assert_equals(credential
.id
, 'id');
54 assert_equals(credential
.name
, '');
55 assert_equals(credential
.iconURL
, '');
56 assert_equals(credential
.provider
, 'https://federation.test/');
57 assert_equals(credential
.type
, 'federated');
58 }, 'Interfaces and attributes of FederatedCredential');
61 assert_throws(new SyntaxError(), function () {
62 var credential
= new FederatedCredential({
64 'provider': 'https://federation.test/',
69 }, 'Construct a FederatedCredential with an invalid Icon URL.');
72 assert_throws(new SyntaxError(), function () {
73 var credential
= new FederatedCredential({
77 'iconURL': 'https://example.test/icon.png'
80 }, 'Construct a FederatedCredential with an invalid federation URL.');