Skip to content

Commit

Permalink
Fixed Arnaud's comments, add support for mocking sources
Browse files Browse the repository at this point in the history
  • Loading branch information
kenchris committed Apr 22, 2024
1 parent 1b69c6b commit 798f314
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ <h3>Supported sources</h3>
<em>global system thermals</em> and the <em>central [=processing unit=]</em>, also know as the CPU.
Future levels of this specification MAY introduce additional [=source types=].
</p>
<p>
If a [=virtual pressure source=] exists, the [=supported source types=] is equal to the
[=source types=] [=map/keys=] in the [=virtual pressure source mapping=] [=ordered map=].
</p>
<pre class="idl">
enum PressureSource { "thermals", "cpu" };
</pre>
Expand Down Expand Up @@ -1609,7 +1613,7 @@ <h2>
Automation
</h2>
<p>
The Compute Pressure API pose a challenge to test authors, as fully
The Compute Pressure API poses a challenge to test authors, as fully
exercising interface requires physical hardware devices that respond in predictable ways.

To address this challenge this document defines a [[WEBDRIVER2]] [=extension
Expand Down Expand Up @@ -1671,7 +1675,7 @@ <h4>
</tr>
</table>
<p>
This [=extension command=] creates a new [=virtual pressure source=] of a certain
This [=extension command=] creates a new [=virtual pressure source=] of a specified
[=source type=]. Calls to {{PressureObserver/observe()}} from {{PressureObserver}} instances
of the same [=source type=] will cause this [=virtual pressure source=] to be used as their
backing pressure source until [[[#delete-virtual-pressure-source]]] is run.
Expand Down Expand Up @@ -1809,6 +1813,13 @@ <h4>
additional [=pending state updates=] and turning on and off reporting by setting the
[=sample update interval=].
</p>
<aside class="note" data-cite="WEBDRIVER2">
Additionally, the [=extension command=] can be used to check whether a source type is created
via the [[[#create-virtual-pressure-source]]] [=extension command=] by checking the response.
If it has not been created the response will contain the [=error=] with
[=error code|WebDriver error code=]
<a data-cite="webdriver2/#dfn-unsupported-operation">unsupported operation</a>.
</aside>
<table class="data">
<caption>
Properties of the parameters argument used by this algorithm
Expand Down Expand Up @@ -1866,7 +1877,8 @@ <h4>
</li>
<li>
If |topLevelVirtualPressureSourceMapping| does not [=map/contain=] |virtualPressureSource|,
return [=error=] with [=error code|WebDriver error code=] [=invalid argument=].
return [=error=] with [=error code|WebDriver error code=]
<a data-cite="webdriver2/#dfn-unsupported-operation">unsupported operation</a>.
</li>
<li>
Let |virtualPressureSource| be |topLevelVirtualPressureSourceMapping|[|virtualPressureSourceType|].
Expand Down Expand Up @@ -1904,10 +1916,10 @@ <h4>
If |sampleInterval| is not an Number, return [=error=] with [=error code|WebDriver error code=] [=invalid argument=].
</li>
<li>
If |sampleInterval| is negative, stop updating the [=mock platform collector=].
If |sampleInterval| is &lt; 0, stop updating the [=mock platform collector=].
</li>
<li>
If |sampleInterval| is positive, start updating the [=mock platform collector=] each |sampleInterval| milliseconds:
If |sampleInterval| is &ge; 0, start updating the [=mock platform collector=] each |sampleInterval| milliseconds:
<ol>
<li>
Let |state| be the result of [=stack/pop|popping=] a value from [=pending state updates=].
Expand Down

0 comments on commit 798f314

Please sign in to comment.