From 989bdb85fc6207df58da7745f503e215ced7a8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 4 Feb 2022 14:48:10 +1100 Subject: [PATCH 1/2] Editorial: bring back Automated Testing into spec --- index.html | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index c1a0e85..531dc6f 100644 --- a/index.html +++ b/index.html @@ -903,14 +903,128 @@

permission=] or by some user agent policy.

-
+

Automated testing

- Automated testing of this specification is performed using the API provided by the Permissions Automation document. + For the purposes of user-agent automation and application testing, this document defines + the following extension commands for the [[WebDriver]] specification.

+
+        dictionary PermissionSetParameters {
+          required PermissionDescriptor descriptor;
+          required PermissionState state;
+          boolean oneRealm = false;
+        };
+      
+
+

+ Set Permission +

+ + + + + + + + + + + +
+ HTTP Method + + URI Template +
+ POST + + /session/{session id}/permissions +
+

+ The Set Permission extension command simulates user modification of a + {{PermissionDescriptor}}'s permission state. +

+

+ The remote end steps are: +

+
    +
  1. Let |parameters| be the |parameters| argument, converted to an IDL value of + type {{PermissionSetParameters}}. If this throws an exception, return a WebDriver + error with WebDriver error code WebDriver invalid argument. +
  2. +
  3. Let |rootDesc| be |parameters|.{{PermissionSetParameters/descriptor}}. +
  4. +
  5. Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL + value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful + feature/permission descriptor type=]. If this throws an exception, return a WebDriver + error with WebDriver error code WebDriver invalid argument. +
  6. +
  7. If |parameters|.{{PermissionSetParameters/state}} is an inappropriate permission + state for any implementation-defined reason, return a WebDriver error with + WebDriver error code WebDriver invalid argument. +

    + For example, user agents that define the "midi" powerful feature as + "always on" may choose to reject command to set the permission state to + {{PermissionState/"denied"}} at this step. +

    +
  8. +
  9. Let |settings| be the [=current settings object=]. +
  10. +
  11. If |settings| is a non-secure context and + |rootDesc|.{{PermissionDescriptor/name}} isn't allowed in [=non-secure + context=], return a WebDriver error with WebDriver error code WebDriver + invalid argument. +
  12. +
  13. If |parameters|.{{PermissionSetParameters/oneRealm}} is true, let |targets| be a + list whose sole member is |settings|. +
  14. +
  15. Otherwise, let |targets| be a list containing all environment settings + objects whose [=environment settings object/origin=] is the + same as the [=environment settings object/origin=] of |settings|. +
  16. +
  17. Let |tasks| be an empty list. +
  18. +
  19. For each environment settings object |target| in |targets|: +
      +
    1. + Queue a task |task| on the permissions task source of |target|'s + [=relevant settings object=]'s [=environment settings object/global object=]'s + [=Window/browsing context=] to perform the following step: +
        +
      1. Interpret |parameters|.{{PermissionSetParameters/state}} as if it were the + result of an invocation of permission state for |typedDescriptor| with the + argument |target| made at this moment. +
      2. +
      +
    2. +
    3. [=list/Append=] |task| to |tasks|. +
    4. +
    +
  20. +
  21. Wait for all tasks in |tasks| to have executed. +
  22. +
  23. Return success with data `null`. +
  24. +
+ +

From 32b594a80d42dda04b4093fbc33004b9cdacb806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Tue, 15 Feb 2022 18:54:49 +1100 Subject: [PATCH 2/2] Fixup xrefs --- index.html | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/index.html b/index.html index 531dc6f..d6bdfbe 100644 --- a/index.html +++ b/index.html @@ -909,7 +909,8 @@

For the purposes of user-agent automation and application testing, this document defines - the following extension commands for the [[WebDriver]] specification. + the following extension commands for the [[WebDriver]] specification. It is OPTIONAL + for a user agent to support extension commands commands.

         dictionary PermissionSetParameters {
@@ -951,19 +952,18 @@ 

  1. Let |parameters| be the |parameters| argument, converted to an IDL value of - type {{PermissionSetParameters}}. If this throws an exception, return a WebDriver - error with WebDriver error code WebDriver invalid argument. + type {{PermissionSetParameters}}. If this throws an exception, return a [=invalid + argument=] [=error=].
  2. Let |rootDesc| be |parameters|.{{PermissionSetParameters/descriptor}}.
  3. Let |typedDescriptor| be the object |rootDesc| refers to, converted to an IDL value of |rootDesc|.{{PermissionDescriptor/name}}'s [=powerful - feature/permission descriptor type=]. If this throws an exception, return a WebDriver - error with WebDriver error code WebDriver invalid argument. + feature/permission descriptor type=]. If this throws an exception, return a [=invalid + argument=] [=error=].
  4. If |parameters|.{{PermissionSetParameters/state}} is an inappropriate permission - state for any implementation-defined reason, return a WebDriver error with - WebDriver error code WebDriver invalid argument. + state for any implementation-defined reason, return a [=invalid argument=] [=error=].

    For example, user agents that define the "midi" powerful feature as "always on" may choose to reject command to set the permission state to @@ -972,11 +972,6 @@

  5. Let |settings| be the [=current settings object=].
  6. -
  7. If |settings| is a non-secure context and - |rootDesc|.{{PermissionDescriptor/name}} isn't allowed in [=non-secure - context=], return a WebDriver error with WebDriver error code WebDriver - invalid argument. -
  8. If |parameters|.{{PermissionSetParameters/oneRealm}} is true, let |targets| be a list whose sole member is |settings|.
  9. @@ -1008,11 +1003,11 @@

  10. Return success with data `null`.
-