Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,32 @@ The [=remote end steps=] are:
1. Let |dialogButton| be the result of [=getting a property=] named
`"dialogButton"` from |parameters|.

1. If |dialogButton| is not a string that is "`ConfirmIdpLoginContinue`", return
1. If |dialogButton| is not a string, return
a [=error|WebDriver error=] with [=error code=] [=invalid argument=].

1. If |dialogButton| is "`TermsOfService`" or "`PrivacyPolicy`":
1. If no FedCM dialog is currently open or the dialog is not a dialog that
lets a user select an account, return a [=error|WebDriver error=] with
[=error code=] [=no such alert=].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right error code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the code I've been using for all the webdriver commands. It seemed close enough and I wanted to avoid defining a new error code.

1. Let |index| be the result of [=getting a property=] named
`"index"` from |parameters|.
1. If |index| is not an integer, or is less than zero or greater than
or equal to the number of accounts that the user can choose from in the
current flow, return a [=error|WebDriver error=] with [=error code=]
[=invalid argument=].
Comment on lines +2203 to +2206
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. If |index| is not an integer, or is less than zero or greater than
or equal to the number of accounts that the user can choose from in the
current flow, return a [=error|WebDriver error=] with [=error code=]
[=invalid argument=].
1. If |index| is not an integer, or is less than zero, or is greater than
or equal to the number of accounts that the user can choose from in the
current flow, then return a [=error|WebDriver error=] with [=error code=]
[=invalid argument=].

1. If the account at |index| does not have a terms of service or privacy
policy URL, either because none was provided in the [=client metadata
endpoint=] or because [=compute the connection status=] for the account
returned [=compute the connection status/connected=], return a
[=error|WebDriver error=] with [=error code=] [=invalid selector=].
1. Otherwise, if |dialogButton| is "`TermsOfService`", open the account's
{{IdentityProviderClientMetadata/terms_of_service_url}}, or if
|dialogButton| is "`PrivacyPolicy`", open the account's
Comment on lines +2207 to +2214
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. If the account at |index| does not have a terms of service or privacy
policy URL, either because none was provided in the [=client metadata
endpoint=] or because [=compute the connection status=] for the account
returned [=compute the connection status/connected=], return a
[=error|WebDriver error=] with [=error code=] [=invalid selector=].
1. Otherwise, if |dialogButton| is "`TermsOfService`", open the account's
{{IdentityProviderClientMetadata/terms_of_service_url}}, or if
|dialogButton| is "`PrivacyPolicy`", open the account's
1. If the account at |index| does not have a terms of service or privacy
policy URL, either because none was provided in the [=client metadata
endpoint=] or because [=compute the connection status=] for the account
returned [=compute the connection status/connected=], then return a
[=error|WebDriver error=] with [=error code=] [=invalid selector=].
1. Otherwise, if |dialogButton| is "`TermsOfService`", open the account's
{{IdentityProviderClientMetadata/terms_of_service_url}}, or if
|dialogButton| is "`PrivacyPolicy`", then open the account's

{{IdentityProviderClientMetadata/privacy_policy_url}}, as if the user
had clicked the corresponding link in the account.
1. Return [=success=] with data `null`.

1. If |dialogButton| is not "`ConfirmIdpLoginContinue`", return
a [=error|WebDriver error=] with [=error code=] [=invalid argument=].

1. If no FedCM dialog is currently open or the dialog is not a [=confirm IDP
Expand Down