GoogleChromeLabs / chromeos_smart_card_connector

Smart Card Connector App for Chrome OS
https://chrome.google.com/webstore/detail/smart-card-connector/khpfeaanjngmcnplbdlpegiifgpfgdco
Apache License 2.0
133 stars 50 forks source link

[PC/SC test] Test delayed card events with GetStatusChange #1101

Closed emaxx-google closed 8 months ago

emaxx-google commented 8 months ago

Duplicate the existing tests for SCardGetStatusChange() in the card insertion/removal scenarios, with introducing a variant of these tests that delays the card insertion/removal by some (hardcoded) interval.

This adds test coverage for some internal implementation codepaths, because the previously existing tests were only triggering events that are immediately discovered by SCardGetStatusChange before it enters the polling loop, and before it starts relying on asynchronous USB notifications from the reader (via interrupt USB transfers).

github-actions[bot] commented 8 months ago

Continuous Integration: All tests passed. C/C++ test coverage: 73.17% lines.

emaxx-google commented 8 months ago

LGTM - optional nit: I would refer to the tests by their name instead of 'previous test', in case some other test is inserted in between

sure, done. thanks!

github-actions[bot] commented 8 months ago

Continuous Integration: All tests passed. C/C++ test coverage: 73.15% lines.