diff options
author | Siarhei Vishniakou <svv@google.com> | 2019-08-12 14:20:09 -0500 |
---|---|---|
committer | Siarhei Vishniakou <svv@google.com> | 2019-08-13 14:41:47 -0500 |
commit | 1fc88e88f6e0ab24a34354355d6610da1dd8c81a (patch) | |
tree | e81613b3c0c751f0899638eaa3690edaad5c792c /tests | |
parent | 9359ffb16b2b8d573dd27930a000190c49cb374d (diff) |
Remove custom timestamp from hw/libhw/input
These are no longer used by EventHub, and should not be carried forward.
Bug: 116601048
Test: presubmit only
Merged-In: I35129484d9945dcd4d291e0f2fac894e07c53c04
Change-Id: I35129484d9945dcd4d291e0f2fac894e07c53c04
Diffstat (limited to 'tests')
-rw-r--r-- | tests/input/evdev/InputDevice_test.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tests/input/evdev/InputDevice_test.cpp b/tests/input/evdev/InputDevice_test.cpp index bd574910..8f8a94b4 100644 --- a/tests/input/evdev/InputDevice_test.cpp +++ b/tests/input/evdev/InputDevice_test.cpp @@ -31,8 +31,6 @@ // # of milliseconds to allow for timing measurements #define TIMING_TOLERANCE_MS 25 -#define MSC_ANDROID_TIME_SEC 0x6 -#define MSC_ANDROID_TIME_USEC 0x7 using ::testing::_; using ::testing::NiceMock; @@ -66,35 +64,6 @@ protected: NiceMock<MockInputDeviceDefinition> mDeviceDef; }; -TEST_F(EvdevDeviceTest, testOverrideTime) { - auto node = std::make_shared<MockInputDeviceNode>(); - auto device = std::make_unique<EvdevDevice>(&mHost, node); - ASSERT_TRUE(device != nullptr); - - // Send two timestamp override events before an input event. - nsecs_t when = 2ULL; - InputEvent msc1 = { when, EV_MSC, MSC_ANDROID_TIME_SEC, 1 }; - InputEvent msc2 = { when, EV_MSC, MSC_ANDROID_TIME_USEC, 900000 }; - - // Send a key down and syn. Should get the overridden timestamp. - InputEvent keyDown = { when, EV_KEY, KEY_HOME, 1 }; - InputEvent syn = { when, EV_SYN, SYN_REPORT, 0 }; - - // Send a key up, which should be at the reported timestamp. - InputEvent keyUp = { when, EV_KEY, KEY_HOME, 0 }; - - device->processInput(msc1, when); - device->processInput(msc2, when); - device->processInput(keyDown, when); - device->processInput(syn, when); - device->processInput(keyUp, when); - - nsecs_t expectedWhen = s2ns(1) + us2ns(900000); - EXPECT_EQ(expectedWhen, keyDown.when); - EXPECT_EQ(expectedWhen, syn.when); - EXPECT_EQ(when, keyUp.when); -} - TEST_F(EvdevDeviceTest, testWrongClockCorrection) { auto node = std::make_shared<MockInputDeviceNode>(); auto device = std::make_unique<EvdevDevice>(&mHost, node); |