Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wayland] Refactor ozone/wayland output tests
This CL makes several changes to how output unittests work. 1. A TestOutputMetrics struct has been introduced that encapsulates any output state needed by TestOutput and its associated test extension classes. This avoids the current scattering of state across test output classes, making it easier to ensure the metrics are consistent (i.e. logical size, physical size, scale are set correctly). This consistency helps make the tests more understandable and correct (the tested state is more representative of what happens in actual production code). 2. TestOutputMetrics are updated via various helpers and flushed collectively to clients (for the wl_output and all extensions) before the wl_output.done event. This is more consistent with what the spec describes and how exo actually handles output updates. Previously metrics could be sent one at a time and/or remain in a pending state depending on how the test had been written. This could result in clients getting stuck in invalid states (IsReady() implementations would return incorrect results as not all expected state had been sent). 3. This CL makes it such that TestOutputMetrics are always flushed to clients after their outputs are bound. This change is consistent with what the spec describes. Previously this behavior was suppressed by not setting any pending metrics (rect/scale). This was not super clear and resulted in verbose tests. The default behavior of flushing on bind is the behavior expected for effectively all existing test cases. The only test case that required suppressing output metrics was LazilyConfiguredScreenTest.DualOutput. This CL instead adds a flag that can be optionally set to suppress output metrics specifically for this test case. This CL goes through and updates various test cases that were impacted by the above changes. In most places an explicit Flush() is no longer required when creating a TestOutput. This change also addresses existing problems such as test cases that had forgotten to Flush() updates or set an appropriate logical transform state. Bug: 1412420 Change-Id: I6b9bacccc47511ce8fcdf06ec7e5246a0da8017d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4298177 Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org> Reviewed-by: Mitsuru Oshima <oshima@chromium.org> Cr-Commit-Position: refs/heads/main@{#1117341}
- Loading branch information