1
-
2
1
import pytest
3
2
from tests .support .sync import AsyncPoll
4
3
@@ -376,14 +375,14 @@ async def on_event(method, data):
376
375
http_equiv_url = url (PAGE_REDIRECT_HTTP_EQUIV )
377
376
redirected_url = url (PAGE_REDIRECTED_HTML )
378
377
379
- result = await bidi_session .browsing_context .navigate (
378
+ await bidi_session .browsing_context .navigate (
380
379
context = top_context ["context" ],
381
380
url = http_equiv_url ,
382
381
wait = "complete" ,
383
382
)
384
383
385
- # Wait until we receive two events, one for the initial navigation and one for
386
- # the http-equiv "redirect".
384
+ # Wait until we receive two events, one for the initial navigation and one
385
+ # for the http-equiv "redirect".
387
386
wait = AsyncPoll (bidi_session , timeout = 2 )
388
387
await wait .until (lambda _ : len (events ) >= 2 )
389
388
@@ -403,6 +402,8 @@ async def on_event(method, data):
403
402
},
404
403
)
405
404
405
+ remove_listener ()
406
+
406
407
407
408
async def test_redirect_navigation (
408
409
bidi_session , subscribe_events , top_context , url
@@ -424,7 +425,7 @@ async def on_event(method, data):
424
425
f"/webdriver/tests/support/http_handlers/redirect.py?location={ html_url } "
425
426
)
426
427
427
- result = await bidi_session .browsing_context .navigate (
428
+ await bidi_session .browsing_context .navigate (
428
429
context = top_context ["context" ],
429
430
url = redirect_url ,
430
431
wait = "complete" ,
@@ -439,6 +440,8 @@ async def on_event(method, data):
439
440
},
440
441
)
441
442
443
+ remove_listener ()
444
+
442
445
443
446
async def test_navigate_history_pushstate (
444
447
bidi_session , inline , new_tab , subscribe_events , wait_for_event
0 commit comments