|
1 | 1 | <!DOCTYPE html>
|
2 |
| -<title>Federated Credential Management API Button Mode priority tests.</title> |
| 2 | +<title>Federated Credential Management API Active Mode priority tests.</title> |
3 | 3 | <link rel="help" href="https://fedidcg.github.io/FedCM">
|
4 | 4 | <script src="/resources/testharness.js"></script>
|
5 | 5 | <script src="/resources/testharnessreport.js"></script>
|
|
12 | 12 | fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js';
|
13 | 13 |
|
14 | 14 | fedcm_test(async t => {
|
15 |
| - let widget_test_options = request_options_with_mediation_required(); |
16 |
| - let button_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
17 |
| - button_test_options.identity.mode = "button"; |
| 15 | + let passive_test_options = request_options_with_mediation_required(); |
| 16 | + let active_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
| 17 | + active_test_options.identity.mode = "active"; |
18 | 18 |
|
19 | 19 | return test_driver.bless('initiate FedCM request', async function() {
|
20 |
| - let first_cred = await fedcm_get_and_select_first_account(t, button_test_options); |
21 |
| - assert_equals(first_cred.token, "mode=button"); |
22 |
| - let second_cred = await fedcm_get_and_select_first_account(t, widget_test_options); |
| 20 | + let first_cred = await fedcm_get_and_select_first_account(t, active_test_options); |
| 21 | + assert_equals(first_cred.token, "mode=active"); |
| 22 | + let second_cred = await fedcm_get_and_select_first_account(t, passive_test_options); |
23 | 23 | assert_equals(second_cred.token, "token");
|
24 | 24 | });
|
25 |
| -}, "Test that the widget mode can succeed after the button mode."); |
| 25 | +}, "Test that the passive mode can succeed after the active mode."); |
26 | 26 |
|
27 | 27 | fedcm_test(async t => {
|
28 |
| - let widget_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
29 |
| - let button_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
30 |
| - button_test_options.identity.mode = "button"; |
| 28 | + let passive_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
| 29 | + let active_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
| 30 | + active_test_options.identity.mode = "active"; |
31 | 31 |
|
32 |
| - let first_cred = navigator.credentials.get(widget_test_options); |
| 32 | + let first_cred = navigator.credentials.get(passive_test_options); |
33 | 33 | let rej = promise_rejects_dom(t, 'NetworkError', first_cred);
|
34 | 34 |
|
35 | 35 | return test_driver.bless('initiate FedCM request', async function() {
|
36 |
| - let second_cred = await fedcm_get_and_select_first_account(t, button_test_options); |
37 |
| - assert_equals(second_cred.token, "mode=button"); |
| 36 | + let second_cred = await fedcm_get_and_select_first_account(t, active_test_options); |
| 37 | + assert_equals(second_cred.token, "mode=active"); |
38 | 38 | await rej;
|
39 | 39 | });
|
40 |
| - }, "Test that the button mode can replace widget mode."); |
| 40 | + }, "Test that the active mode can replace passive mode."); |
41 | 41 |
|
42 | 42 | fedcm_test(async t => {
|
43 |
| - let button_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
44 |
| - button_test_options.identity.mode = "button"; |
| 43 | + let active_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
| 44 | + active_test_options.identity.mode = "active"; |
45 | 45 |
|
46 | 46 | return test_driver.bless('initiate FedCM request', async function() {
|
47 |
| - let first_cred = fedcm_get_and_select_first_account(t, button_test_options); |
48 |
| - let second_cred = navigator.credentials.get(button_test_options); |
| 47 | + let first_cred = fedcm_get_and_select_first_account(t, active_test_options); |
| 48 | + let second_cred = navigator.credentials.get(active_test_options); |
49 | 49 | let rej = promise_rejects_dom(t, 'NotAllowedError', second_cred);
|
50 | 50 |
|
51 | 51 | let cred = await first_cred;
|
52 |
| - assert_equals(cred.token, "mode=button"); |
| 52 | + assert_equals(cred.token, "mode=active"); |
53 | 53 | await rej;
|
54 | 54 | });
|
55 |
| -}, "Test that the button mode cannot replace button mode."); |
| 55 | +}, "Test that the active mode cannot replace active mode."); |
56 | 56 |
|
57 | 57 | fedcm_test(async t => {
|
58 |
| - let widget_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
59 |
| - let button_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
60 |
| - button_test_options.identity.mode = "button"; |
| 58 | + let passive_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
| 59 | + let active_test_options = request_options_with_mediation_required("manifest_with_rp_mode.json"); |
| 60 | + active_test_options.identity.mode = "active"; |
61 | 61 |
|
62 | 62 | return test_driver.bless('initiate FedCM request', async function() {
|
63 |
| - let first_cred = fedcm_get_and_select_first_account(t, button_test_options); |
64 |
| - let second_cred = navigator.credentials.get(widget_test_options); |
| 63 | + let first_cred = fedcm_get_and_select_first_account(t, active_test_options); |
| 64 | + let second_cred = navigator.credentials.get(passive_test_options); |
65 | 65 | let rej = promise_rejects_dom(t, 'NotAllowedError', second_cred);
|
66 | 66 |
|
67 | 67 | let cred = await first_cred;
|
68 |
| - assert_equals(cred.token, "mode=button"); |
| 68 | + assert_equals(cred.token, "mode=active"); |
69 | 69 | await rej;
|
70 | 70 | });
|
71 |
| -}, "Test that the widget mode cannot replace button mode."); |
| 71 | +}, "Test that the passive mode cannot replace active mode."); |
72 | 72 |
|
73 | 73 | </script>
|
0 commit comments