Skip to content

Commit 524fa50

Browse files
[FedCM] Modifying function to reduce timeout (#53701)
Modified fedcm_get_and_select_first_account() to reduce timeout. Bug: 41482163 Change-Id: Ibeb065dc0c6df63efc9be8544fc65e15667d98aa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6723950 Reviewed-by: Christian Biesinger <[email protected]> Reviewed-by: Nicolás Peña <[email protected]> Commit-Queue: Nicolás Peña <[email protected]> Cr-Commit-Position: refs/heads/main@{#1485156} Co-authored-by: jaimukund <[email protected]>
1 parent 20184d6 commit 524fa50

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

fedcm/support/fedcm-helper.sub.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,15 @@ export async function fedcm_select_account_promise(t, account_index) {
239239
await window.test_driver.select_fedcm_account(account_index);
240240
}
241241

242-
export function fedcm_get_and_select_first_account(t, options) {
242+
export async function fedcm_get_and_select_first_account(t, options) {
243243
const credentialPromise = navigator.credentials.get(options);
244-
fedcm_select_account_promise(t, 0);
244+
let type = await fedcm_expect_dialog(
245+
credentialPromise,
246+
fedcm_get_dialog_type_promise(t)
247+
);
248+
if (type != "AccountChooser")
249+
throw "Incorrect dialog type: " + type;
250+
await window.test_driver.select_fedcm_account(0);
245251
return credentialPromise;
246252
}
247253

0 commit comments

Comments
 (0)