Skip to content

Commit 8bc75c3

Browse files
committed
Made functions async
1 parent 26379a0 commit 8bc75c3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

py/selenium/webdriver/common/bidi/network.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, conn):
3636
self.conn = conn
3737
self.callbacks = {}
3838

39-
def continue_response(self, request_id, status_code, headers=None, body=None):
39+
async def continue_response(self, request_id, status_code, headers=None, body=None):
4040
params = {
4141
'requestId': request_id,
4242
'status': status_code
@@ -45,9 +45,9 @@ def continue_response(self, request_id, status_code, headers=None, body=None):
4545
params['headers'] = headers
4646
if body is not None:
4747
params['body'] = body
48-
self.conn.execute('network.continueResponse', params)
48+
await self.conn.execute('network.continueResponse', params)
4949

50-
def continue_request(self, request_id, url=None, method=None, headers=None, postData=None):
50+
async def continue_request(self, request_id, url=None, method=None, headers=None, postData=None):
5151
params = {
5252
'requestId': request_id
5353
}
@@ -59,23 +59,23 @@ def continue_request(self, request_id, url=None, method=None, headers=None, post
5959
params['headers'] = headers
6060
if postData is not None:
6161
params['postData'] = postData
62-
self.conn.execute('network.continueRequest', params)
62+
await self.conn.execute('network.continueRequest', params)
6363

64-
def add_intercept(self, phases=None, contexts=None, url_patterns=None):
64+
async def add_intercept(self, phases=None, contexts=None, url_patterns=None):
6565
if phases is None:
6666
phases = []
6767
params = {
6868
'phases': phases,
6969
'contexts': contexts,
7070
'urlPatterns': url_patterns
7171
}
72-
self.conn.execute('network.addIntercept', params)
72+
await self.conn.execute('network.addIntercept', params)
7373

74-
def remove_intercept(self, intercept):
75-
self.conn.execute('network.removeIntercept', {'intercept': intercept})
74+
async def remove_intercept(self, intercept):
75+
await self.conn.execute('network.removeIntercept', {'intercept': intercept})
7676

77-
def continue_with_auth(self, request_id, username, password):
78-
self.conn.execute(
77+
async def continue_with_auth(self, request_id, username, password):
78+
await self.conn.execute(
7979
'network.continueWithAuth',
8080
{
8181
'request': request_id,
@@ -88,7 +88,7 @@ def continue_with_auth(self, request_id, username, password):
8888
}
8989
)
9090

91-
def on(self, event, callback):
91+
async def on(self, event, callback):
9292
event = self.EVENTS.get(event, event)
9393
self.callbacks[event] = callback
94-
session_subscribe(self.conn, event, self.handle_event)
94+
await session_subscribe(self.conn, event, self.handle_event)

0 commit comments

Comments
 (0)