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

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

Use a RAII-style test session to ensure input tests are hermetic

The static InputManagerGlobal instance is created on the first call on
getInstance(). It is a static variable because there should only be one
instance per process.

The old appraoch to testing would reset the existing instance with a
test instance, and clear it later. This affects the test state, since
the assumption that there is only one real InputManagerGlobal instance per
process is broken, as a second instance can be created after clearing.

To make these tests hermetic, we use a TestSession tracker to that will
be closed at the end of the test, which will replace the test instance
with the original one.

Bug: 290274722
Test: atest InputTests
Change-Id: I5291d5c7097ec741fab37de82c8935096921e1f8
parent db1180a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment