mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-30 02:18:16 +00:00
fix(tests): ensure the client is open when stopping screen recording
[no changelog]
This commit is contained in:
parent
9748a56a55
commit
508b6a87e6
@ -618,6 +618,11 @@ class TrezorClientDebugLink(TrezorClient):
|
|||||||
Callable[[protobuf.MessageType], protobuf.MessageType],
|
Callable[[protobuf.MessageType], protobuf.MessageType],
|
||||||
] = {}
|
] = {}
|
||||||
|
|
||||||
|
def ensure_open(self) -> None:
|
||||||
|
"""Only open session if there isn't already an open one."""
|
||||||
|
if self.session_counter == 0:
|
||||||
|
self.open()
|
||||||
|
|
||||||
def open(self) -> None:
|
def open(self) -> None:
|
||||||
super().open()
|
super().open()
|
||||||
if self.session_counter == 1:
|
if self.session_counter == 1:
|
||||||
|
@ -153,6 +153,7 @@ def screen_recording(
|
|||||||
client.debug.start_recording(str(screen_path))
|
client.debug.start_recording(str(screen_path))
|
||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
|
client.ensure_open()
|
||||||
# Wait for response to Initialize, which gives the emulator time to catch up
|
# Wait for response to Initialize, which gives the emulator time to catch up
|
||||||
# and redraw the homescreen. Otherwise there's a race condition between that
|
# and redraw the homescreen. Otherwise there's a race condition between that
|
||||||
# and stopping recording.
|
# and stopping recording.
|
||||||
|
Loading…
Reference in New Issue
Block a user