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

Skip to content
Commit ea395bfb authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

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
parent 943fb054
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