Skip to content

Commit 89a40d9

Browse files
yi-guchromium-wpt-export-bot
authored andcommitted
[FedCM] Rename mode button -> active, widget -> passive
This patch renames the mode values in the code base except for 4 places: 1. feature/flag 2. metrics 3. file name 4. webdriver GitHub repo: https://github.com/w3c-fedid/active-mode Bug: 370696611 Change-Id: I13a08a8e2fe8201afd8daacbd334b66223d38bc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5905546 Reviewed-by: Christian Biesinger <[email protected]> Commit-Queue: Yi Gu <[email protected]> Reviewed-by: Joe Mason <[email protected]> Reviewed-by: Dave Tapuska <[email protected]> Cr-Commit-Position: refs/heads/main@{#1366300}
1 parent 5bc7939 commit 89a40d9

5 files changed

+45
-45
lines changed

fedcm/fedcm-button-and-other-account/fedcm-button-mode-auto-selected-flag.tentative.https.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<title>Federated Credential Management API Button Mode auto selected flag tests.</title>
2+
<title>Federated Credential Management API Active Mode auto selected flag tests.</title>
33
<link rel="help" href="https://fedidcg.github.io/FedCM">
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
@@ -14,7 +14,7 @@
1414

1515
fedcm_test(async t => {
1616
let test_options = request_options_with_mediation_optional("manifest_with_auto_selected_flag.json");
17-
test_options.identity.mode = "button";
17+
test_options.identity.mode = "active";
1818

1919
return test_driver.bless('initiate FedCM request', async function() {
2020
await select_manifest(t, test_options);
@@ -29,6 +29,6 @@
2929
assert_equals(cred.token, "is_auto_selected=true");
3030
assert_equals(cred.isAutoSelected, true);
3131
});
32-
}, "Test that the auto selected flag can be true in button mode.");
32+
}, "Test that the auto selected flag can be true in active mode.");
3333

3434
</script>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<title>Federated Credential Management API Button Mode basic tests.</title>
2+
<title>Federated Credential Management API Active Mode basic tests.</title>
33
<link rel="help" href="https://fedidcg.github.io/FedCM">
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
@@ -14,32 +14,32 @@
1414

1515
fedcm_test(async t => {
1616
let test_options = request_options_with_mediation_required();
17-
test_options.identity.mode = "button";
17+
test_options.identity.mode = "active";
1818
await select_manifest(t, test_options);
1919

2020
let result = navigator.credentials.get(test_options);
2121
return promise_rejects_dom(t, 'NetworkError', result);
22-
}, "Test that the button mode without user activation will fail.");
22+
}, "Test that the active mode without user activation will fail.");
2323

2424
fedcm_test(async t => {
2525
let test_options = request_options_with_mediation_required("manifest_with_rp_mode.json");
26-
test_options.identity.mode = "button";
26+
test_options.identity.mode = "active";
2727

2828
return test_driver.bless('initiate FedCM request', async function() {
2929
let cred = await fedcm_get_and_select_first_account(t, test_options);
30-
assert_equals(cred.token, "mode=button");
30+
assert_equals(cred.token, "mode=active");
3131
});
32-
}, "Test that the button mode succeeds with user activation.");
32+
}, "Test that the active mode succeeds with user activation.");
3333

3434
fedcm_test(async t => {
3535
let test_options = request_options_with_mediation_required("manifest_with_rp_mode.json");
36-
test_options.identity.mode = "button";
36+
test_options.identity.mode = "active";
3737
test_options.mediation = "silent";
3838

3939
return test_driver.bless('initiate FedCM request', async function() {
4040
let cred = fedcm_get_and_select_first_account(t, test_options);
4141
let rej = promise_rejects_dom(t, 'NotSupportedError', cred);
4242
await rej;
4343
});
44-
}, "Test that the mediation:silent is not supported in button mode.");
44+
}, "Test that the mediation:silent is not supported in active mode.");
4545
</script>
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<title>Federated Credential Management API Button Mode priority tests.</title>
2+
<title>Federated Credential Management API Active Mode priority tests.</title>
33
<link rel="help" href="https://fedidcg.github.io/FedCM">
44
<script src="/resources/testharness.js"></script>
55
<script src="/resources/testharnessreport.js"></script>
@@ -12,62 +12,62 @@
1212
fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js';
1313

1414
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";
1818

1919
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);
2323
assert_equals(second_cred.token, "token");
2424
});
25-
}, "Test that the widget mode can succeed after the button mode.");
25+
}, "Test that the passive mode can succeed after the active mode.");
2626

2727
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";
3131

32-
let first_cred = navigator.credentials.get(widget_test_options);
32+
let first_cred = navigator.credentials.get(passive_test_options);
3333
let rej = promise_rejects_dom(t, 'NetworkError', first_cred);
3434

3535
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");
3838
await rej;
3939
});
40-
}, "Test that the button mode can replace widget mode.");
40+
}, "Test that the active mode can replace passive mode.");
4141

4242
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";
4545

4646
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);
4949
let rej = promise_rejects_dom(t, 'NotAllowedError', second_cred);
5050

5151
let cred = await first_cred;
52-
assert_equals(cred.token, "mode=button");
52+
assert_equals(cred.token, "mode=active");
5353
await rej;
5454
});
55-
}, "Test that the button mode cannot replace button mode.");
55+
}, "Test that the active mode cannot replace active mode.");
5656

5757
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";
6161

6262
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);
6565
let rej = promise_rejects_dom(t, 'NotAllowedError', second_cred);
6666

6767
let cred = await first_cred;
68-
assert_equals(cred.token, "mode=button");
68+
assert_equals(cred.token, "mode=active");
6969
await rej;
7070
});
71-
}, "Test that the widget mode cannot replace button mode.");
71+
}, "Test that the passive mode cannot replace active mode.");
7272

7373
</script>

fedcm/fedcm-button-and-other-account/fedcm-use-other-account-button-flow.tentative.https.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
let test_options =
2828
request_options_with_mediation_required("manifest_with_variable_accounts.json");
29-
test_options.identity.mode = "button";
29+
test_options.identity.mode = "active";
3030
await select_manifest(t, test_options);
3131

3232
// Trigger FedCM and wait for the initial dialog.
@@ -50,15 +50,15 @@
5050
await window.test_driver.select_fedcm_account(0);
5151
const cred = await cred_promise;
5252
assert_equals(cred.token, "account_id=jane_doe");
53-
}, 'Test that the "Use Other Account" button works correctly.');
53+
}, 'Test that the "Use Other Account" active works correctly.');
5454

5555

5656
fedcm_test(async t => {
5757
await set_accounts_cookie("1");
5858

5959
let test_options =
6060
request_options_with_mediation_required("manifest_with_variable_accounts.json");
61-
test_options.identity.mode = "button";
61+
test_options.identity.mode = "active";
6262
await select_manifest(t, test_options);
6363

6464
// Trigger FedCM and wait for the initial dialog.
@@ -80,6 +80,6 @@
8080
await window.test_driver.select_fedcm_account(0);
8181
const cred = await cred_promise;
8282
assert_equals(cred.token, "account_id=1234");
83-
}, 'Test that the "Use Other Account" button works correctly when accounts do not change.');
83+
}, 'Test that the "Use Other Account" active works correctly when accounts do not change.');
8484

8585
</script>

fedcm/support/manifest_with_variable_accounts.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"id_assertion_endpoint": "token_with_account_id.py",
55
"login_url": "login.html",
66
"modes": {
7-
"button": {
7+
"active": {
88
"supports_use_other_account": true
99
},
10-
"widget": {
10+
"passive": {
1111
"supports_use_other_account": true
1212
}
1313
}

0 commit comments

Comments
 (0)