InputMapperUnitTest: extract device creation from SetUp
When device creation occurs, configuration properties are copied from
the property map returned by EventHub::getConfiguration into the device
object. For this reason, some tests (such as the CursorInputMapper tests
that have yet to be migrated to InputMapperUnitTest) need to run some
setup code before the device is created. Other tests can simply call
createDevice immediately after InputMapperUnitTest::SetUp in their own
SetUp methods.
Bug: 283812079
Test: atest inputflinger_tests
Change-Id: I3ae3d407fb14e8f8ff061ec617003f423bce3f5e
diff --git a/services/inputflinger/tests/TouchpadInputMapper_test.cpp b/services/inputflinger/tests/TouchpadInputMapper_test.cpp
index 8cf738c..91958e8 100644
--- a/services/inputflinger/tests/TouchpadInputMapper_test.cpp
+++ b/services/inputflinger/tests/TouchpadInputMapper_test.cpp
@@ -107,6 +107,7 @@
*outValue = 0;
return OK;
});
+ createDevice();
mMapper = createInputMapper<TouchpadInputMapper>(*mDeviceContext, mReaderConfiguration);
}
};