Skip to content

Introduce `WssyFuture` and `Client::process_events_until` to abstract common waiting patterns

Alexandros Frantzis requested to merge afrantzis/way-assay:wssyfuture into main

Note that this MR is based on top of !16 (merged). See only the last 3 commits in this branch for the actual changes.

The current xdg-shell test code (correctly?) assumes that the initial configure event may not arrive immediately, so waits a bit before declaring failure if the event doesn't arrive. However, since the test code itself is responsible for dispatching events, and it is not doing so while waiting, the test will never process any subsequent events.

This proposal fixes this by:

  1. Introducing WssyFuture to abstract the concept of a value that is not available yet (so tests won't need to deal with all the details themselves). Note that there is no WssyFuture::wait function, since such a function is pointless in the absence of multiple threads (of course we can add it later if in the future we have tests that need many threads).
  2. Introducing Client::process_events_until() to allow tests to easily process events while waiting for a condition or timeout.

Merge request reports

Loading