mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 14:31:20 +03:00
monkey_driver: Unbreak window condition code so timeouts can happen
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
cf798ba79a
commit
eae3756c55
@ -173,17 +173,19 @@ def conds_met(ctx, conds):
|
|||||||
window = cond['window']
|
window = cond['window']
|
||||||
assert status == "complete" or status == "loading" # TODO: Add more status support?
|
assert status == "complete" or status == "loading" # TODO: Add more status support?
|
||||||
if window == "*all*":
|
if window == "*all*":
|
||||||
# all windows must be not throbbing
|
# all windows must be complete, or any still loading
|
||||||
throbbing = False
|
throbbing = False
|
||||||
for win in ctx['windows'].items():
|
for win in ctx['windows'].items():
|
||||||
if win[1].throbbing:
|
if win[1].throbbing:
|
||||||
throbbing = True
|
throbbing = True
|
||||||
# throbbing and want loading => true
|
# throbbing and want loading => true
|
||||||
# not throbbing and want complete => true
|
# not throbbing and want complete => true
|
||||||
return (status == "loading") == throbbing
|
if (status == "loading") == throbbing:
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
win = ctx['windows'][window]
|
win = ctx['windows'][window]
|
||||||
return win.throbbing == (status == "loading")
|
if win.throbbing == (status == "loading"):
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
raise AssertionError("Unknown condition: {}".format(repr(cond)))
|
raise AssertionError("Unknown condition: {}".format(repr(cond)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user