Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5a67a560 authored by Egor Pasko's avatar Egor Pasko
Browse files

Add InputChannel::waitForMessage and use it in EndToEndNativeInputTest

The EndToEndNativeInputTest::waitForEventAvailable(timeoutMs) is similar
in implementation to InputChannel::probablyHasInput(), but can stop
after a timeout.

Add InputChannel::waitForMessage(std::chrono::milliseconds timeout) for
use in tests and use it to replace the waitForEventAvailable().

The difference of the new method from probablyHasInput() is that the
latter does not get repeated (because it is not necessary to implement
the hint). Repeating happens only on EINTR to allow tests to return
before timeout expiration when there are problems with the channel
setup. In the end the implementations are rather different.

Bug: b/314973388
Test: atest frameworks/native/libs/gui/tests/EndToEndNativeInputTest.cpp
Test: atest InputPublisherAndConsumerTest
Change-Id: I806aad14e4fba223a5cbbe49cea862f9b8279f24
parent 55ea9f4a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment