Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated WebDriver Extension API into to Generic Sensor spec #377

Merged
merged 2 commits into from
Jan 24, 2019

Conversation

Honry
Copy link
Contributor

@Honry Honry commented Jan 17, 2019

This is just copy and paste to move WebDriver Extension API into
a new section "Automation" in Generic Sensor spec with some necessary
adjustment on the sections and editorial alignment.


Preview | Diff

This is just copy and paste to move WebDriver Extension API into
a new section "Automation" in Generic Sensor spec with some necessary
adjustment on the sections and editorial alignment.
@Honry Honry force-pushed the integrate-extension-api branch from 53d1006 to c64af87 Compare January 17, 2019 06:35
@Honry
Copy link
Contributor Author

Honry commented Jan 17, 2019

@anssiko and all, PTAL. Thanks!

@anssiko
Copy link
Member

anssiko commented Jan 17, 2019

Thanks @Honry!

Since the contents of this PR has already been reviewed in #369 I'll just focus my comments on how to possibly split test automation spec bits across specs.

All - would you prefer to see mock sensor types (sections 9.1.3.*) integrated into corresponding concrete sensor specs? That might make maintenance easier if/when those specs add new API surface that need to be accompanied with corresponding new mock sensor reading values.

Also, to acknowledge @Honry's contributions to testing and automation and make it clear to folks who to contact for testing related bits in the spec, I'd suggest adding the following to the headers:

!Test Facilitator: Wanming Lin (Intel Corporation)

@Honry
Copy link
Contributor Author

Honry commented Jan 18, 2019

@anssiko, thank you for the acknowledgment!

I think with a standalone issue would be better to track your suggestion on integration of mock sensor types into corresponding concrete sensor specs. And I just made it at #378, and please feel free to assign it to me. :)

@reillyeon
Copy link
Member

The merge into this spec looks good. @anssiko are you okay with merging this PR as-is and then splitting out the mock sensor type definitions to the appropriate specs or should that work happen first?

@anssiko
Copy link
Member

anssiko commented Jan 24, 2019

I'm fine with that. Let's merge. @Honry to take the lead in splitting the mock sensor types into appropriate concrete specs in separate PRs.

@anssiko anssiko merged commit 3909a33 into w3c:master Jan 24, 2019
@Honry Honry deleted the integrate-extension-api branch January 25, 2019 02:50
rakuco pushed a commit to rakuco/sensors that referenced this pull request Jul 27, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Additionally, the same virtual sensors are used by all navigables that have
the same top-level traversable. In other words, all iframes under the same
main frame, regardless of their origin, share the same virtual sensors. Not
only does this match the behavior of real, hardware-based sensors more
closely, but it also helps with a limitation in web-platform-tests'
testdriver.js that only allows WebDriver communication to go through the
page that creates the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Jul 27, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Aug 1, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Aug 2, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Aug 3, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Aug 8, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Aug 8, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Aug 10, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit to rakuco/sensors that referenced this pull request Aug 10, 2023
…ands

The previous version from w3c#369 and w3c#377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.
rakuco pushed a commit that referenced this pull request Oct 6, 2023
…ands (#470)

The previous version from #369 and #377 was never implemented by any
engines, and the language it used made it hard to actually implement and use
in tests (such as those already present in web-platform-tests). For example:
- Mock sensors acted like a mix of device sensors and platform sensors, and
  the distinction was not entirely clear.
- Mock sensors had a separate readings map that never really integrated with
  the "latest reading" concept used in the abstract operations.
- The language in the "Create mock sensor" extension command did not make it
  clear if it was attempting to create Sensor objects or hand-wavingly
  change existing Sensor objects' associated platform sensor.
- Implementing the custom WebDriver error codes specified here was not
  trivial and did not bring much extra benefit (other specifications refrain
  from doing it as well).
- Calling "convert to an IDL value" to convert JSON Objects to a platform
  version is not always trivial to implement since it actually requires a
  lot of extra WebIDL processing steps that are not really needed here.

The new version uses more precise language in the algorithms and properly
integrates into the existing abstract operations. It has also been verified
to work with Chromium, ChromeDriver and the required changes to
web-platform-tests.

"Mock sensors" are now called "virtual sensors" to follow the same
terminology adopted by the WebAuthn spec.

Conceptually, they are now defined as device sensors and therefore always
exist at a layer below a platform sensor. This clears up ambiguities and
delimits what is expected of platform sensors and what can actually be
influenced by a virtual sensor.

Some auxiliary concepts also had to be defined, both of which are expected
to be set by extension specifications:
- "Virtual sensor metadata" is a struct with a sensor type and an algorithm
  to parse the readings sent to the "update virtual sensor reading"
  extension command.
- "Per-type virtual sensor metadata" is a mapping of strings to virtual
  sensor metadata instances. This allows us to get rid of MockSensorType, as
  the keys are then used to identify a given sensor type in the WebDriver
  extension commands and each specification defines one or more keys.

The same virtual sensors are used by all navigables that have the same
top-level traversable. In other words, all iframes under the same main
frame, regardless of their origin, share the same virtual sensors. Not only
does this match the behavior of real, hardware-based sensors more closely,
but it also helps with a limitation in web-platform-tests' testdriver.js
that only allows WebDriver communication to go through the page that creates
the test harness.

Co-authored-by: Reilly Grant <reillyeon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants