diff options
author | Siarhei Vishniakou <svv@google.com> | 2020-05-06 14:18:38 -0700 |
---|---|---|
committer | Siarhei Vishniakou <svv@google.com> | 2020-05-06 21:25:36 -0700 |
commit | 097c3db9fc66ffb6f1b55401229bcc43d885a3ed (patch) | |
tree | a85a8088218adf0f548010b07501a60961cf1661 /libs/gui/tests/EndToEndNativeInputTest.cpp | |
parent | fb9fcdae2f67ebef2ab6522fd2b49a57f9c28dd2 (diff) |
Use <chrono> for input-related timeouts
There is a lot of confusion in input tests about the units used for the
timeouts. In a lot of cases, the timeouts are set too short, which
causes failures when they start getting enforced. To avoid this, use
std::chrono::duration for the timeouts.
Ideally, we should convert InputWindowInfo and InputApplicationInfo to
use std::chrono::nanoseconds, but that would be a larger change reserved
for a future release.
Bug: 143459140
Test: atest inputflinger_tests libinput_tests inputflinger_benchmarks
Change-Id: Ie7536e8a042a71b372f03314501e0d635a6ac1d4
Diffstat (limited to 'libs/gui/tests/EndToEndNativeInputTest.cpp')
-rw-r--r-- | libs/gui/tests/EndToEndNativeInputTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp index c59afba87c..5188a09c4b 100644 --- a/libs/gui/tests/EndToEndNativeInputTest.cpp +++ b/libs/gui/tests/EndToEndNativeInputTest.cpp @@ -178,7 +178,7 @@ private: mInputInfo.name = "Test info"; mInputInfo.layoutParamsFlags = InputWindowInfo::FLAG_NOT_TOUCH_MODAL; mInputInfo.layoutParamsType = InputWindowInfo::TYPE_BASE_APPLICATION; - mInputInfo.dispatchingTimeout = 100000; + mInputInfo.dispatchingTimeout = seconds_to_nanoseconds(5); mInputInfo.globalScaleFactor = 1.0; mInputInfo.canReceiveKeys = true; mInputInfo.hasFocus = true; @@ -196,7 +196,7 @@ private: InputApplicationInfo aInfo; aInfo.token = new BBinder(); aInfo.name = "Test app info"; - aInfo.dispatchingTimeout = 100000; + aInfo.dispatchingTimeout = seconds_to_nanoseconds(5); mInputInfo.applicationInfo = aInfo; } |