Skip to content

Commit 875b865

Browse files
test: --enable-features=WebBluetooth by default (#3480)
1 parent a067884 commit 875b865

File tree

7 files changed

+3
-163
lines changed

7 files changed

+3
-163
lines changed

tests/bluetooth/test_characteristic_emulation.py

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ async def teardown(websocket, context_id):
137137

138138

139139
@pytest.mark.asyncio
140-
@pytest.mark.parametrize('capabilities', [{
141-
'goog:chromeOptions': {
142-
'args': ['--enable-features=WebBluetooth']
143-
}
144-
}],
145-
indirect=True)
146140
@pytest.mark.parametrize('property', [
147141
'broadcast', 'read', 'writeWithoutResponse', 'write', 'notify', 'indicate',
148142
'authenticatedSignedWrites'
@@ -193,12 +187,6 @@ async def test_bluetooth_simulateCharacteristic(websocket, context_id, html,
193187

194188

195189
@pytest.mark.asyncio
196-
@pytest.mark.parametrize('capabilities', [{
197-
'goog:chromeOptions': {
198-
'args': ['--enable-features=WebBluetooth']
199-
}
200-
}],
201-
indirect=True)
202190
async def test_bluetooth_add_same_characteristic_uuid_twice(
203191
websocket, context_id):
204192
device_address = await setup_device(websocket, context_id)
@@ -219,12 +207,6 @@ async def test_bluetooth_add_same_characteristic_uuid_twice(
219207

220208

221209
@pytest.mark.asyncio
222-
@pytest.mark.parametrize('capabilities', [{
223-
'goog:chromeOptions': {
224-
'args': ['--enable-features=WebBluetooth']
225-
}
226-
}],
227-
indirect=True)
228210
async def test_bluetooth_remove_unknown_characteristic_uuid(
229211
websocket, context_id):
230212
device_address = await setup_device(websocket, context_id)
@@ -245,12 +227,6 @@ async def test_bluetooth_remove_unknown_characteristic_uuid(
245227

246228

247229
@pytest.mark.asyncio
248-
@pytest.mark.parametrize('capabilities', [{
249-
'goog:chromeOptions': {
250-
'args': ['--enable-features=WebBluetooth']
251-
}
252-
}],
253-
indirect=True)
254230
async def test_bluetooth_add_characteristic_to_unknown_device(
255231
websocket, context_id):
256232
await execute_command(
@@ -273,12 +249,6 @@ async def test_bluetooth_add_characteristic_to_unknown_device(
273249

274250

275251
@pytest.mark.asyncio
276-
@pytest.mark.parametrize('capabilities', [{
277-
'goog:chromeOptions': {
278-
'args': ['--enable-features=WebBluetooth']
279-
}
280-
}],
281-
indirect=True)
282252
async def test_bluetooth_add_characteristic_to_unknown_service(
283253
websocket, context_id):
284254
device_address = await setup_device(websocket, context_id)
@@ -296,12 +266,6 @@ async def test_bluetooth_add_characteristic_to_unknown_service(
296266

297267

298268
@pytest.mark.asyncio
299-
@pytest.mark.parametrize('capabilities', [{
300-
'goog:chromeOptions': {
301-
'args': ['--enable-features=WebBluetooth']
302-
}
303-
}],
304-
indirect=True)
305269
async def test_bluetooth_remove_characteristic_uuid_with_properties(
306270
websocket, context_id):
307271
device_address = await setup_device(websocket, context_id)
@@ -336,12 +300,6 @@ async def test_bluetooth_remove_characteristic_uuid_with_properties(
336300

337301

338302
@pytest.mark.asyncio
339-
@pytest.mark.parametrize('capabilities', [{
340-
'goog:chromeOptions': {
341-
'args': ['--enable-features=WebBluetooth']
342-
}
343-
}],
344-
indirect=True)
345303
@pytest.mark.parametrize(
346304
'write_type', [('writeValueWithoutResponse', 'write-without-response'),
347305
('writeValueWithResponse', 'write-with-response')])
@@ -396,12 +354,6 @@ async def test_bluetooth_characteristic_write_event(websocket, context_id,
396354

397355

398356
@pytest.mark.asyncio
399-
@pytest.mark.parametrize('capabilities', [{
400-
'goog:chromeOptions': {
401-
'args': ['--enable-features=WebBluetooth']
402-
}
403-
}],
404-
indirect=True)
405357
async def test_bluetooth_characteristic_read_event(websocket, context_id,
406358
html):
407359
await setup_characteristic(websocket, context_id, html,
@@ -466,12 +418,6 @@ async def test_bluetooth_characteristic_read_event(websocket, context_id,
466418

467419

468420
@pytest.mark.asyncio
469-
@pytest.mark.parametrize('capabilities', [{
470-
'goog:chromeOptions': {
471-
'args': ['--enable-features=WebBluetooth']
472-
}
473-
}],
474-
indirect=True)
475421
async def test_bluetooth_characteristic_notification_event(
476422
websocket, context_id, html):
477423
device_address = await setup_characteristic(websocket, context_id, html,

tests/bluetooth/test_descriptor_emulation.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ async def teardown(websocket, context_id):
8484

8585

8686
@pytest.mark.asyncio
87-
@pytest.mark.parametrize('capabilities', [{
88-
'goog:chromeOptions': {
89-
'args': ['--enable-features=WebBluetooth']
90-
}
91-
}],
92-
indirect=True)
9387
async def test_bluetooth_simulateService(websocket, context_id, html):
9488
device_address = await setup_granted_device(
9589
websocket, context_id, html,
@@ -145,12 +139,6 @@ async def test_bluetooth_simulateService(websocket, context_id, html):
145139

146140

147141
@pytest.mark.asyncio
148-
@pytest.mark.parametrize('capabilities', [{
149-
'goog:chromeOptions': {
150-
'args': ['--enable-features=WebBluetooth']
151-
}
152-
}],
153-
indirect=True)
154142
async def test_bluetooth_add_same_descriptor_uuid_twice(websocket, context_id):
155143
device_address = await setup_device(websocket, context_id)
156144
await simulate_service(websocket, context_id, device_address,
@@ -177,12 +165,6 @@ async def test_bluetooth_add_same_descriptor_uuid_twice(websocket, context_id):
177165

178166

179167
@pytest.mark.asyncio
180-
@pytest.mark.parametrize('capabilities', [{
181-
'goog:chromeOptions': {
182-
'args': ['--enable-features=WebBluetooth']
183-
}
184-
}],
185-
indirect=True)
186168
async def test_bluetooth_remove_unknown_descriptor_uuid(websocket, context_id):
187169
device_address = await setup_device(websocket, context_id)
188170
await simulate_service(websocket, context_id, device_address,
@@ -209,12 +191,6 @@ async def test_bluetooth_remove_unknown_descriptor_uuid(websocket, context_id):
209191

210192

211193
@pytest.mark.asyncio
212-
@pytest.mark.parametrize('capabilities', [{
213-
'goog:chromeOptions': {
214-
'args': ['--enable-features=WebBluetooth']
215-
}
216-
}],
217-
indirect=True)
218194
async def test_bluetooth_add_descriptor_to_unknown_device(
219195
websocket, context_id):
220196
await execute_command(
@@ -238,12 +214,6 @@ async def test_bluetooth_add_descriptor_to_unknown_device(
238214

239215

240216
@pytest.mark.asyncio
241-
@pytest.mark.parametrize('capabilities', [{
242-
'goog:chromeOptions': {
243-
'args': ['--enable-features=WebBluetooth']
244-
}
245-
}],
246-
indirect=True)
247217
async def test_bluetooth_add_descriptor_to_unknown_service(
248218
websocket, context_id):
249219
device_address = await setup_device(websocket, context_id)
@@ -261,12 +231,6 @@ async def test_bluetooth_add_descriptor_to_unknown_service(
261231

262232

263233
@pytest.mark.asyncio
264-
@pytest.mark.parametrize('capabilities', [{
265-
'goog:chromeOptions': {
266-
'args': ['--enable-features=WebBluetooth']
267-
}
268-
}],
269-
indirect=True)
270234
async def test_bluetooth_add_descriptor_to_unknown_characteristic(
271235
websocket, context_id):
272236
device_address = await setup_device(websocket, context_id)
@@ -288,12 +252,6 @@ async def test_bluetooth_add_descriptor_to_unknown_characteristic(
288252

289253

290254
@pytest.mark.asyncio
291-
@pytest.mark.parametrize('capabilities', [{
292-
'goog:chromeOptions': {
293-
'args': ['--enable-features=WebBluetooth']
294-
}
295-
}],
296-
indirect=True)
297255
async def test_bluetooth_descriptor_write_event(websocket, context_id, html):
298256
await setup_descriptor(websocket, context_id, html,
299257
HEART_RATE_SERVICE_UUID,
@@ -348,12 +306,6 @@ async def test_bluetooth_descriptor_write_event(websocket, context_id, html):
348306

349307

350308
@pytest.mark.asyncio
351-
@pytest.mark.parametrize('capabilities', [{
352-
'goog:chromeOptions': {
353-
'args': ['--enable-features=WebBluetooth']
354-
}
355-
}],
356-
indirect=True)
357309
async def test_bluetooth_descriptor_read_event(websocket, context_id, html):
358310
await setup_descriptor(websocket, context_id, html,
359311
HEART_RATE_SERVICE_UUID,

tests/bluetooth/test_emulation.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ async def teardown(websocket, context_id):
3131
@pytest.mark.asyncio
3232
@pytest.mark.parametrize("state_1", ["absent", "powered-off", "powered-on"])
3333
@pytest.mark.parametrize("state_2", ["absent", "powered-off", "powered-on"])
34-
@pytest.mark.parametrize('capabilities', [{
35-
'goog:chromeOptions': {
36-
'args': ['--enable-features=WebBluetooth']
37-
}
38-
}],
39-
indirect=True)
4034
async def test_simulate_create_adapter_twice(websocket, context_id, state_1,
4135
state_2):
4236
await execute_command(
@@ -59,12 +53,6 @@ async def test_simulate_create_adapter_twice(websocket, context_id, state_1,
5953

6054

6155
@pytest.mark.asyncio
62-
@pytest.mark.parametrize('capabilities', [{
63-
'goog:chromeOptions': {
64-
'args': ['--enable-features=WebBluetooth']
65-
}
66-
}],
67-
indirect=True)
6856
async def test_bluetooth_requestDevicePromptUpdated(websocket, context_id,
6957
html):
7058
await subscribe(websocket, ['bluetooth'])
@@ -86,12 +74,6 @@ async def test_bluetooth_requestDevicePromptUpdated(websocket, context_id,
8674

8775

8876
@pytest.mark.asyncio
89-
@pytest.mark.parametrize('capabilities', [{
90-
'goog:chromeOptions': {
91-
'args': ['--enable-features=WebBluetooth']
92-
}
93-
}],
94-
indirect=True)
9577
@pytest.mark.parametrize('accept', [True, False])
9678
async def test_bluetooth_handleRequestDevicePrompt(websocket, context_id, html,
9779
accept):

tests/bluetooth/test_gatt_connection.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ async def teardown(websocket, context_id):
4444

4545

4646
@pytest.mark.asyncio
47-
@pytest.mark.parametrize('capabilities', [{
48-
'goog:chromeOptions': {
49-
'args': ['--enable-features=WebBluetooth']
50-
}
51-
}],
52-
indirect=True)
5347
@pytest.mark.parametrize('code', [0x0, 0x1, 0x2])
5448
async def test_bluetooth_simulateGattConnectionResponse(
5549
websocket, context_id, html, code):

tests/bluetooth/test_handle_prompt.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ async def teardown(websocket, context_id):
2929

3030

3131
@pytest.mark.asyncio
32-
@pytest.mark.parametrize('capabilities', [{
33-
'goog:chromeOptions': {
34-
'args': ['--enable-features=WebBluetooth']
35-
}
36-
}],
37-
indirect=True)
3832
async def test_bluetooth_requestDevicePromptUpdated(websocket, context_id,
3933
html):
4034
await subscribe(websocket, ['bluetooth.requestDevicePromptUpdated'])
@@ -56,12 +50,6 @@ async def test_bluetooth_requestDevicePromptUpdated(websocket, context_id,
5650

5751

5852
@pytest.mark.asyncio
59-
@pytest.mark.parametrize('capabilities', [{
60-
'goog:chromeOptions': {
61-
'args': ['--enable-features=WebBluetooth']
62-
}
63-
}],
64-
indirect=True)
6553
@pytest.mark.parametrize('accept', [True, False])
6654
async def test_bluetooth_handleRequestDevicePrompt(websocket, context_id, html,
6755
accept):

tests/bluetooth/test_service_emulation.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ async def teardown(websocket, context_id):
5858

5959

6060
@pytest.mark.asyncio
61-
@pytest.mark.parametrize('capabilities', [{
62-
'goog:chromeOptions': {
63-
'args': ['--enable-features=WebBluetooth']
64-
}
65-
}],
66-
indirect=True)
6761
async def test_bluetooth_simulateService(websocket, context_id, html):
6862
device_address = await setup_granted_device(
6963
websocket, context_id, html,
@@ -91,12 +85,6 @@ async def test_bluetooth_simulateService(websocket, context_id, html):
9185

9286

9387
@pytest.mark.asyncio
94-
@pytest.mark.parametrize('capabilities', [{
95-
'goog:chromeOptions': {
96-
'args': ['--enable-features=WebBluetooth']
97-
}
98-
}],
99-
indirect=True)
10088
async def test_bluetooth_add_same_service_uuid_twice(websocket, context_id):
10189
device_address = await setup_device(websocket, context_id)
10290
await simulate_service(websocket, context_id, device_address,
@@ -112,12 +100,6 @@ async def test_bluetooth_add_same_service_uuid_twice(websocket, context_id):
112100

113101

114102
@pytest.mark.asyncio
115-
@pytest.mark.parametrize('capabilities', [{
116-
'goog:chromeOptions': {
117-
'args': ['--enable-features=WebBluetooth']
118-
}
119-
}],
120-
indirect=True)
121103
async def test_bluetooth_remove_unknown_service_uuid(websocket, context_id):
122104
device_address = await setup_device(websocket, context_id)
123105
with pytest.raises(
@@ -131,12 +113,6 @@ async def test_bluetooth_remove_unknown_service_uuid(websocket, context_id):
131113

132114

133115
@pytest.mark.asyncio
134-
@pytest.mark.parametrize('capabilities', [{
135-
'goog:chromeOptions': {
136-
'args': ['--enable-features=WebBluetooth']
137-
}
138-
}],
139-
indirect=True)
140116
async def test_bluetooth_add_service_to_unknown_device(websocket, context_id):
141117
await execute_command(
142118
websocket, {

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ async def create_session(connection):
120120
"args": [
121121
"--disable-infobars",
122122
# Required to prevent automatic switch to https.
123-
'--disable-features=HttpsFirstBalancedModeAutoEnable,HttpsUpgrades'
123+
"--disable-features=HttpsFirstBalancedModeAutoEnable,HttpsUpgrades",
124+
# Required for bluetooth testing.
125+
"--enable-features=WebBluetooth"
124126
]
125127
}
126128
}

0 commit comments

Comments
 (0)