@@ -49,20 +49,12 @@ urlPrefix: https://html.spec.whatwg.org/multipage/; spec: HTML
49
49
urlPrefix: https://w3ctag.github.io/security-questionnaire/; spec: SECURITY-PRIVACY-QUESTIONNAIRE
50
50
type: dfn
51
51
text: same-origin policy violations; url: sop-violations
52
- urlPrefix: https://w3c.github.io/webdriver/; spec: WebDriver
52
+ urlPrefix: https://w3c.github.io/webdriver/; spec: WEBDRIVER2
53
53
type: dfn
54
54
text: current browsing context; url: dfn-current-browsing-context
55
- text: WebDriver error; url: dfn-errors
56
55
text: WebDriver error code; url: dfn-error-code
57
- text: extension commands; url: dfn-extension-command
58
- text: remote end steps; url: dfn-remote-end-steps
59
- text: extension command URI template; url: dfn-extension-command-uri-template
60
- text: invalid argument; url: dfn-invalid-argument
61
56
text: local end; url: dfn-local-ends
62
57
text: url variable; url: dfn-url-variables
63
- text: session; url: dfn-sessions
64
- text: success; url: dfn-success
65
- text: handling errors
66
58
text: Object; url: dfn-object
67
59
text: no longer open; url: dfn-no-longer-open
68
60
text: no such window; url: dfn-no-such-window
@@ -97,6 +89,7 @@ urlPrefix: https://w3c.github.io/proximity; spec: PROXIMITY
97
89
spec: webidl; type:dfn; text:attribute
98
90
spec: webidl; type:dfn; text:dictionary member
99
91
spec: webidl; type:dfn; text:identifier
92
+ spec: webdriver-2; type:dfn; text:error
100
93
</pre>
101
94
102
95
<pre class=biblio>
@@ -1572,7 +1565,7 @@ to {{SensorErrorEventInit}}.
1572
1565
The Generic Sensor API and its [=extension specifications=] pose a challenge
1573
1566
to test authors, as fully exercising those interfaces requires physical hardware
1574
1567
devices that respond in predictable ways. To address this challenge this document
1575
- defines a number of [=extension commands=] to the [[WebDriver ]] specification
1568
+ defines a number of [=extension commands=] to the [[WEBDRIVER2 ]] specification
1576
1569
for controlling [=mock sensor=] on the host that the user agent is running on.
1577
1570
With these [=extension commands=] , devices with particular properties can be created
1578
1571
and their responses to requests are well defined.
@@ -1754,14 +1747,12 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
1754
1747
1755
1748
The [=remote end steps=] are:
1756
1749
1. Let |configuration| be the |configuration| parameter, [=converted to an IDL value=]
1757
- of type {{MockSensorConfiguration}} . If this throws an exception, return a
1758
- [=WebDriver error =] with [=WebDriver error code=] [=invalid argument =] .
1750
+ of type {{MockSensorConfiguration}} . If this throws an exception, return an
1751
+ [=invalid argument =] [= error=] .
1759
1752
1. Let |type| be the |configuration|.{{MockSensorConfiguration/mockSensorType}} . If the [=current browsing context=]
1760
- already has this |type| of [=mock sensor=] , return a [=WebDriver error=] with [=WebDriver error code=]
1761
- [=mock sensor already created=] .
1762
- 1. If the [=current browsing context=] is [=no longer open=] , return a [=WebDriver error=] with
1763
- [=WebDriver error code=] [=no such window=] .
1764
- 1. [=Handle any user prompts=] , and return its value if it is a [=WebDriver error=] .
1753
+ already has this |type| of [=mock sensor=] , return a [=mock sensor already created=] [=error=] .
1754
+ 1. If the [=current browsing context=] is [=no longer open=] , return a [=no such window=] [=error=] .
1755
+ 1. [=Handle any user prompts=] , and return its value if it is an [=error=] .
1765
1756
1. Run these sub-steps [=in parallel=] to create a [=mock sensor=] in the [=current browsing context=] :
1766
1757
1. Let |mock| be a new [=mock sensor=] .
1767
1758
1. Set |mock|'s [=mock sensor type=] to |type|.
@@ -1786,7 +1777,7 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
1786
1777
}
1787
1778
</pre>
1788
1779
Be aware that only one [=mock sensor=] of a given [=mock sensor type=] can be created in [=current browsing context=] ,
1789
- otherwise a [=WebDriver error=] with [=WebDriver error code= ] [=mock sensor already created =] will be thrown.
1780
+ otherwise a [=mock sensor already created= ] [=error =] will be thrown.
1790
1781
</div>
1791
1782
1792
1783
### Get mock sensor ### {#get-mock-sensor-command}
@@ -1811,13 +1802,11 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
1811
1802
1812
1803
The [=remote end steps=] are:
1813
1804
1. Let |type| be a [=url variable=] , [=converted to an IDL value=] of type {{MockSensorType}} .
1814
- If this throws an exception, return a [=WebDriver error=] with [=WebDriver error code=]
1815
- [=invalid argument=] .
1816
- 1. If the [=current browsing context=] is [=no longer open=] , return a [=WebDriver error=] with
1817
- [=WebDriver error code=] [=no such window=] .
1818
- 1. [=Handle any user prompts=] , and return its value if it is a [=WebDriver error=] .
1805
+ If this throws an exception, return an [=invalid argument=] [=error=] .
1806
+ 1. If the [=current browsing context=] is [=no longer open=] , return a [=no such window=] [=error=] .
1807
+ 1. [=Handle any user prompts=] , and return its value if it is an [=error=] .
1819
1808
1. If |type| does not match a [=mock sensor type=] amongst all associated [=mock sensors=] of the
1820
- [=current browsing context=] , return a [=WebDriver error=] with [=WebDriver error code= ] [=no such mock sensor =] .
1809
+ [=current browsing context=] , return a [=no such mock sensor= ] [=error =] .
1821
1810
1. Return [=success=] with the [=serialized mock sensor=] as data.
1822
1811
</div>
1823
1812
@@ -1843,16 +1832,14 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
1843
1832
1844
1833
The [=remote end steps=] are:
1845
1834
1. Let |type| be a [=url variable=] , [=converted to an IDL value=] of type {{MockSensorType}} .
1846
- If this throws an exception, return a [=WebDriver error=] with [=WebDriver error code=]
1847
- [=invalid argument=] .
1848
- 1. If the [=current browsing context=] is [=no longer open=] , return a [=WebDriver error=] with
1849
- [=WebDriver error code=] [=no such window=] .
1850
- 1. [=Handle any user prompts=] , and return its value if it is a [=WebDriver error=] .
1835
+ If this throws an exception, return an [=invalid argument=] [=error=] .
1836
+ 1. If the [=current browsing context=] is [=no longer open=] , return a [=no such window=] [=error=] .
1837
+ 1. [=Handle any user prompts=] , and return its value if it is an [=error=] .
1851
1838
1. If |type| does not match a [=mock sensor type=] amongst all associated [=mock sensors=] of the
1852
- [=current browsing context=] , return a [=WebDriver error=] with [=WebDriver error code= ] [=no such mock sensor =] .
1839
+ [=current browsing context=] , return a [=no such mock sensor= ] [=error =] .
1853
1840
1. Let |reading| be the |reading| argument, [=converted to an IDL value=] of the |type|'s
1854
- associated {{MockSensorReadingValues}} . If this throws an exception, return a
1855
- [=WebDriver error =] with [=WebDriver error code=] [=invalid argument =] .
1841
+ associated {{MockSensorReadingValues}} . If this throws an exception, return an
1842
+ [=invalid argument =] [= error=] .
1856
1843
1. [=map/For each=] |key| → <var ignore> value</var> of |reading|.
1857
1844
1. [=map/Set=] [=mock sensor reading=] [|key|] to the corresponding value of |reading|.
1858
1845
1. Return [=success=] with data `null`.
@@ -1880,20 +1867,18 @@ Each [=mock sensor type=] has a [=mock sensor reading values=] dictionary:
1880
1867
1881
1868
The [=remote end steps=] are:
1882
1869
1. Let |type| be a [=url variable=] .
1883
- 1. If {{MockSensorType}} [=set/contains|does not contain=] |type|, return a [=WebDriver error=] with
1884
- [=WebDriver error code=] [=invalid argument=] .
1885
- 1. If the [=current browsing context=] is [=no longer open=] , return a [=WebDriver error=] with
1886
- [=WebDriver error code=] [=no such window=] .
1887
- 1. [=Handle any user prompts=] , and return its value if it is a [=WebDriver error=] .
1870
+ 1. If {{MockSensorType}} [=set/contains|does not contain=] |type|, return an [=invalid argument=] [=error=] .
1871
+ 1. If the [=current browsing context=] is [=no longer open=] , return a [=no such window=] [=error=] .
1872
+ 1. [=Handle any user prompts=] , and return its value if it is an [=error=] .
1888
1873
1. If |type| does not match a [=mock sensor type=] amongst all associated [=mock sensors=] of the
1889
- [=current browsing context=] , return a [=WebDriver error=] with [=WebDriver error code= ] [=no such mock sensor =] .
1874
+ [=current browsing context=] , return a [=no such mock sensor= ] [=error =] .
1890
1875
1. Delete |type| of [=mock sensor=] in [=current browsing context=] .
1891
1876
1. Return [=success=] with data `null`.
1892
1877
</div>
1893
1878
1894
1879
<h3 id="extension-handling-errors">Handling errors</h3>
1895
1880
1896
- This section extends the [=Handling Errors=] and defines extended [=WebDriver error codes=]
1881
+ This section extends the [[WEBDRIVER2#errors]] section and defines extended [=WebDriver error codes=]
1897
1882
specific for [=mock sensor=] in following table.
1898
1883
1899
1884
<table id="mock-sensor-error-code" class="def">
0 commit comments