mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-09 04:40:06 +00:00
tests/egis_etu905: Actually test the device identify cancellation path
This commit is contained in:
committed by
Marco Trevisan
parent
68aa38ed9d
commit
a6240828c1
Binary file not shown.
@@ -108,6 +108,23 @@ def identify_cancelled_cb(dev, res):
|
||||
print(f"Identify cancelled with error: {e}")
|
||||
|
||||
d.identify(deserialized_prints, cancellable=cancellable, callback=identify_cancelled_cb)
|
||||
|
||||
print("--- IDENTIFY STARTED, CANCELLING IMMEDIATELY ---")
|
||||
cancellable.cancel()
|
||||
|
||||
while not identify_cancelled:
|
||||
ctx.iteration(True)
|
||||
print(f"--- CANCELLATION TEST DONE, result: {cancel_result} ---")
|
||||
|
||||
cancellable = Gio.Cancellable()
|
||||
identify_cancelled = False
|
||||
cancel_result = None
|
||||
d.identify(deserialized_prints, cancellable=cancellable, callback=identify_cancelled_cb)
|
||||
|
||||
# Wait until the device is actually waiting for a finger before cancelling.
|
||||
print("Waiting for device to reach wait-for-finger stage before cancelling...")
|
||||
while not (d.get_finger_status() & FPrint.FingerStatusFlags.NEEDED):
|
||||
ctx.iteration(True)
|
||||
cancellable.cancel()
|
||||
|
||||
while not identify_cancelled:
|
||||
|
||||
Reference in New Issue
Block a user