From 460e396540be7116f8a5795e6898ee9d788bdda0 Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Thu, 30 May 2024 16:57:14 -0400 Subject: [PATCH] Specify the webdriver command to open terms of service and privacy policy --- spec/index.bs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/spec/index.bs b/spec/index.bs index b1a568a4..5ef90869 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -2297,7 +2297,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=]. + 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=]. + 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 argument=]. + 1. Otherwise, if |dialogButton| is "`TermsOfService`", open the account's + {{IdentityProviderAccount/terms_of_service_url}}, or if |dialogButton| + is "`PrivacyPolicy`", open the account's + {{IdentityProviderAccount/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