Skip to content

Commit 3e6e1ad

Browse files
Survey845chromium-wpt-export-bot
authored andcommitted
[FedCM] Adding mark_signed_in to fedcm_test
Adding mark_signed_in to the beginning of fedcm_test ensures that user is in a signed in state for each test. Tests calling mark_signed_out but never sign back in cause flakiness in repeated test runs. This change fixes that. Bug: 41482163 Change-Id: Ib533bba63e73f59da32ce597f6a690873d0cf884 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6804547 Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Cr-Commit-Position: refs/heads/main@{#1495722}
1 parent d27db1e commit 3e6e1ad

15 files changed

Lines changed: 4 additions & 74 deletions

fedcm/fedcm-accounts-endpoint-rejects-redirects.https.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
import {request_options_with_mediation_required,
1111
fedcm_test,
1212
select_manifest,
13-
mark_signed_in,
1413
fedcm_get_dialog_type_promise} from './support/fedcm-helper.sub.js';
1514

1615
fedcm_test(async t => {
17-
await mark_signed_in();
18-
1916
let test_options = request_options_with_mediation_required("manifest_redirect_accounts.json");
2017
await select_manifest(t, test_options);
2118

fedcm/fedcm-auto-reauthn-without-approved-clients.https.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
<script type="module">
1010
import {request_options_with_mediation_optional,
1111
fedcm_test,
12-
mark_signed_in,
1312
select_manifest,
1413
fedcm_get_and_select_first_account} from './support/fedcm-helper.sub.js';
1514

1615
fedcm_test(async t => {
17-
await mark_signed_in();
1816
let test_options = request_options_with_mediation_optional(
1917
"manifest_with_single_account.json");
2018
test_options.identity.providers[0].clientId = 'nomatch';

fedcm/fedcm-disconnect-errors.https.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@
1010

1111
<script type="module">
1212
import {fedcm_test,
13-
mark_signed_in,
14-
set_fedcm_cookie,
1513
fedcm_get_and_select_first_account,
1614
manifest_origin,
1715
request_options_with_mediation_required,
1816
select_manifest,
1917
disconnect_options} from './support/fedcm-helper.sub.js';
2018

2119
fedcm_test(async t => {
22-
await mark_signed_in();
23-
await set_fedcm_cookie();
2420
// Get at least one connected account that can be disconnected.
2521
const cred = await fedcm_get_and_select_first_account(t,
2622
request_options_with_mediation_required());
@@ -41,8 +37,6 @@
4137
}, "disconnect requires 3 parameters: configURL, clientId, and accountHint");
4238

4339
fedcm_test(async t => {
44-
await mark_signed_in();
45-
await set_fedcm_cookie();
4640
// Get at least one connected account that can be disconnected.
4741
const cred = await fedcm_get_and_select_first_account(t,
4842
request_options_with_mediation_required());
@@ -55,8 +49,6 @@
5549
to the config file");
5650

5751
fedcm_test(async t => {
58-
await mark_signed_in();
59-
await set_fedcm_cookie();
6052
// Get at least one connected account that can be disconnected.
6153
const cred = await fedcm_get_and_select_first_account(t,
6254
request_options_with_mediation_required());

fedcm/fedcm-disconnect.sub.https.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
<script type="module">
1313
import {fedcm_test,
14-
mark_signed_in,
1514
disconnect_options,
1615
fedcm_get_and_select_first_account,
1716
fedcm_select_account_promise,
@@ -22,7 +21,6 @@
2221
set_alt_fedcm_cookie} from './support/fedcm-helper.sub.js';
2322

2423
fedcm_test(async t => {
25-
await mark_signed_in(alt_manifest_origin);
2624
// Get at least one connected account that can be disconnected.
2725
const cred = await fedcm_get_and_select_first_account(t, alt_request_options_with_mediation_required());
2826
// The IDP implementation will accept any account hint, so this is really testing that the user
@@ -48,14 +46,12 @@
4846
}, 'Test that disconnect fails when there is no account to disconnect');
4947

5048
fedcm_test(async t => {
51-
await mark_signed_in(alt_manifest_origin);
5249
const cred = await fedcm_get_and_select_first_account(t, alt_request_options_with_mediation_required());
5350

5451
return IdentityCredential.disconnect(alt_disconnect_options("1234"));
5552
}, 'Test that disconnect succeeds when there is an account to disconnect');
5653

5754
fedcm_test(async t => {
58-
await mark_signed_in(alt_manifest_origin);
5955
const cred = await fedcm_get_and_select_first_account(t, alt_request_options_with_mediation_required());
6056

6157
await IdentityCredential.disconnect(alt_disconnect_options("1234"));
@@ -65,16 +61,13 @@
6561
}, 'Test that disconnecting the same account twice results in failure.');
6662

6763
fedcm_test(async t => {
68-
await mark_signed_in(alt_manifest_origin);
6964
const cred = await fedcm_get_and_select_first_account(t, alt_request_options_with_mediation_required());
7065
// A connected account is guaranteed by the above, and IDP accepts any account hint, so this tests
7166
// that the user agent allows the request to go through to the IDP.
7267
return IdentityCredential.disconnect(alt_disconnect_options("noMatch"));
7368
}, 'Disconnect passing an incorrect ID can still succeed');
7469

7570
fedcm_test(async t => {
76-
await mark_signed_in();
77-
await mark_signed_in(alt_manifest_origin);
7871
await fedcm_get_and_select_first_account(t, alt_request_options_with_mediation_required());
7972
await fedcm_get_and_select_first_account(t,
8073
request_options_with_mediation_required());
@@ -86,7 +79,6 @@
8679
}, 'Disconnect is bound to each IDP');
8780

8881
fedcm_test(async t => {
89-
await mark_signed_in(alt_manifest_origin);
9082
// Get at least one connected account that can be disconnected.
9183
await fedcm_get_and_select_first_account(t, alt_request_options_with_mediation_required());
9284

fedcm/fedcm-identity-assertion-nocors.https.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
import {alt_request_options_with_mediation_required,
1111
fedcm_test,
1212
select_manifest,
13-
mark_signed_in,
1413
fedcm_error_dialog_dismiss,
1514
fedcm_select_account_promise} from './support/fedcm-helper.sub.js';
1615

1716
fedcm_test(async t => {
18-
await mark_signed_in();
1917
let test_options = alt_request_options_with_mediation_required("manifest-token-nocors.json");
2018
await select_manifest(t, test_options);
2119
try {

fedcm/fedcm-login-status-unknown.https.html

Lines changed: 0 additions & 23 deletions
This file was deleted.

fedcm/fedcm-login-status/confirm-idp-login.https.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
import {request_options_with_mediation_required,
1111
fedcm_test,
1212
fedcm_get_dialog_type_promise,
13-
select_manifest,
14-
mark_signed_in} from '../support/fedcm-helper.sub.js';
13+
select_manifest} from '../support/fedcm-helper.sub.js';
1514

1615
fedcm_test(async t => {
17-
await mark_signed_in();
18-
1916
let test_options = request_options_with_mediation_required("manifest_with_variable_accounts.json");
2017
await select_manifest(t, test_options);
2118

fedcm/fedcm-login-status/login-page-broken.https.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
import {request_options_with_mediation_required,
1111
fedcm_test,
1212
fedcm_get_dialog_type_promise,
13-
select_manifest,
14-
mark_signed_in} from '../support/fedcm-helper.sub.js';
13+
select_manifest} from '../support/fedcm-helper.sub.js';
1514

1615
fedcm_test(async t => {
17-
await mark_signed_in();
18-
1916
let test_options = request_options_with_mediation_required("manifest_broken_login.json");
2017
await select_manifest(t, test_options);
2118

fedcm/fedcm-loginhint.https.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@
1111
import {fedcm_test,
1212
request_options_with_login_hint,
1313
select_manifest,
14-
mark_signed_in,
1514
fedcm_get_dialog_type_promise,
1615
fedcm_get_and_select_first_account} from './support/fedcm-helper.sub.js';
1716

1817
fedcm_test(async t => {
19-
await mark_signed_in();
20-
2118
let options = request_options_with_login_hint('manifest.py', 'nomatch');
2219
const cred = navigator.credentials.get(options);
2320
// We expect a mismatch dialog.

fedcm/fedcm-no-domainhint-matches-account.https.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@
1111
import {
1212
fedcm_test,
1313
request_options_with_domain_hint,
14-
mark_signed_in,
1514
fedcm_get_dialog_type_promise,
1615
fedcm_expect_dialog,
1716
} from './support/fedcm-helper.sub.js';
1817

1918
fedcm_test(async t => {
20-
await mark_signed_in();
21-
2219
let options = request_options_with_domain_hint('manifest.py',
2320
'nomatch');
2421
const cred = navigator.credentials.get(options);

0 commit comments

Comments
 (0)