diff options
author | 2025-01-25 00:46:04 +0000 | |
---|---|---|
committer | 2025-01-28 17:15:06 +0000 | |
commit | ea395bfbeb4a53e3c9b7466b7031a8c8819d7659 (patch) | |
tree | c53a3a64dea59ec802284434adb37cdef93c690d /libs/gui/ConsumerBase.cpp | |
parent | 943fb054a84ce3464da6b615b862e1391273849b (diff) |
Add tests for AndroidInputEventProtoConverter::toProtoMotionEvent
We use mocked classes as stand-ins for the Perfetto proto classes. Since
Perfetto uses ProtoZero where the generated C++ classes do not allow for
readback, they cannot be used directly in the tests. The generated proto
classes' methods are also non-virtual, so we cannot override them in
tests.
We are therefore using a templating strategy to provide separte mock
implementations of the proto classes for testing. This has the
additional benefits of:
- giving a build error if a new unmocked method is used in the test,
reminding us to add tests for newly traced fields; and
- allowing us to use strict mocks to easily enforce that more information
is not traced compared to what is expected by the tests.
Bug: 391468016
Test: Presubmit
Flag: TEST_ONLY
Change-Id: I73c090e86b30eaed416fc8d2b05a162832d4ec00
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
0 files changed, 0 insertions, 0 deletions