1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-02-11 23:22:50 +00:00

fixup! test(core): don't fetch DebugLinkState by default

This commit is contained in:
Roman Zeyde 2025-02-06 19:05:59 +02:00
parent a59d598f0e
commit 26ab041f47
3 changed files with 7 additions and 14 deletions

View File

@ -59,18 +59,6 @@ def go_next(debug: "DebugLink") -> LayoutContent:
return debug.read_layout() return debug.read_layout()
def tap_to_confirm(debug: "DebugLink") -> LayoutContent:
if debug.layout_type is LayoutType.Bolt:
return debug.read_layout()
elif debug.layout_type is LayoutType.Caesar:
return debug.read_layout()
elif debug.layout_type is LayoutType.Delizia:
debug.click(buttons.TAP_TO_CONFIRM)
return debug.read_layout()
else:
raise RuntimeError("Unknown model")
def go_back(debug: "DebugLink", r_middle: bool = False) -> LayoutContent: def go_back(debug: "DebugLink", r_middle: bool = False) -> LayoutContent:
if debug.layout_type in (LayoutType.Bolt, LayoutType.Delizia): if debug.layout_type in (LayoutType.Bolt, LayoutType.Delizia):
debug.click(buttons.CANCEL) debug.click(buttons.CANCEL)

View File

@ -30,7 +30,7 @@ from .. import translations as TR
from ..device_tests.bitcoin.payment_req import make_coinjoin_request from ..device_tests.bitcoin.payment_req import make_coinjoin_request
from ..tx_cache import TxCache from ..tx_cache import TxCache
from . import recovery from . import recovery
from .common import go_next, tap_to_confirm, unlock_gesture from .common import go_next, unlock_gesture
if TYPE_CHECKING: if TYPE_CHECKING:
from trezorlib.debuglink import DebugLink, LayoutContent from trezorlib.debuglink import DebugLink, LayoutContent
@ -71,7 +71,8 @@ def set_autolock_delay(device_handler: "BackgroundDeviceHandler", delay_ms: int)
layout = go_next(debug) layout = go_next(debug)
if debug.layout_type is LayoutType.Delizia: if debug.layout_type is LayoutType.Delizia:
layout = tap_to_confirm(debug) debug.click(buttons.TAP_TO_CONFIRM)
layout = debug.read_layout()
assert layout.main_component() == "Homescreen" assert layout.main_component() == "Homescreen"
device_handler.result() device_handler.result()

View File

@ -211,6 +211,10 @@ def _cancel_pin(debug: "DebugLink") -> None:
# It is the same button as DELETE # It is the same button as DELETE
# TODO: implement cancel PIN for TR? # TODO: implement cancel PIN for TR?
_delete_pin(debug, 1, check=False) _delete_pin(debug, 1, check=False)
# Note: `prepare()` context manager will send a tap after PIN cancellation,
# so we make sure the lockscreen is already up to receive it -- otherwise
# the input event may get lost in the loop restart.
assert debug.read_layout().main_component() != "PinKeyboard" assert debug.read_layout().main_component() != "PinKeyboard"