summaryrefslogtreecommitdiffstats
path: root/libs/input
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-05-14 16:29:13 +0100
committerMichael Wright <michaelwr@google.com>2015-05-14 16:29:13 +0100
commitb03f103fd40d9028731a81e87a817a3e3bd07fa4 (patch)
tree2d66401069139c019054dfcedcb7f41b23b38245 /libs/input
parent7b159c9a4f589da7fdab7c16f3aefea25e0e7e4f (diff)
downloadframeworks_native-b03f103fd40d9028731a81e87a817a3e3bd07fa4.zip
frameworks_native-b03f103fd40d9028731a81e87a817a3e3bd07fa4.tar.gz
frameworks_native-b03f103fd40d9028731a81e87a817a3e3bd07fa4.tar.bz2
Fix input tests to work with new MotionEvent member
Change-Id: I0dde0f91f693903f26edc116b5dbcbf33bac2b93
Diffstat (limited to 'libs/input')
-rw-r--r--libs/input/tests/InputEvent_test.cpp4
-rw-r--r--libs/input/tests/InputPublisherAndConsumer_test.cpp9
-rw-r--r--libs/input/tests/StructLayout_test.cpp9
3 files changed, 12 insertions, 10 deletions
diff --git a/libs/input/tests/InputEvent_test.cpp b/libs/input/tests/InputEvent_test.cpp
index 9105ae5..3fb1c6d 100644
--- a/libs/input/tests/InputEvent_test.cpp
+++ b/libs/input/tests/InputEvent_test.cpp
@@ -248,7 +248,7 @@ void MotionEventTest::initializeEventWithHistory(MotionEvent* event) {
pointerCoords[1].setAxisValue(AMOTION_EVENT_AXIS_TOOL_MAJOR, 26);
pointerCoords[1].setAxisValue(AMOTION_EVENT_AXIS_TOOL_MINOR, 27);
pointerCoords[1].setAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, 28);
- event->initialize(2, AINPUT_SOURCE_TOUCHSCREEN, AMOTION_EVENT_ACTION_MOVE,
+ event->initialize(2, AINPUT_SOURCE_TOUCHSCREEN, AMOTION_EVENT_ACTION_MOVE, 0,
AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED,
AMOTION_EVENT_EDGE_FLAG_TOP, AMETA_ALT_ON, AMOTION_EVENT_BUTTON_PRIMARY,
X_OFFSET, Y_OFFSET, 2.0f, 2.1f,
@@ -557,7 +557,7 @@ TEST_F(MotionEventTest, Transform) {
pointerCoords[i].setAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, angle);
}
MotionEvent event;
- event.initialize(0, 0, AMOTION_EVENT_ACTION_MOVE, 0, 0, 0, 0,
+ event.initialize(0, 0, AMOTION_EVENT_ACTION_MOVE, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, pointerCount, pointerProperties, pointerCoords);
float originalRawX = 0 + 3;
float originalRawY = -RADIUS + 2;
diff --git a/libs/input/tests/InputPublisherAndConsumer_test.cpp b/libs/input/tests/InputPublisherAndConsumer_test.cpp
index de192f1..8e69c9c 100644
--- a/libs/input/tests/InputPublisherAndConsumer_test.cpp
+++ b/libs/input/tests/InputPublisherAndConsumer_test.cpp
@@ -133,6 +133,7 @@ void InputPublisherAndConsumerTest::PublishAndConsumeMotionEvent() {
const int32_t deviceId = 1;
const int32_t source = AINPUT_SOURCE_TOUCHSCREEN;
const int32_t action = AMOTION_EVENT_ACTION_MOVE;
+ const int32_t actionButton = 0;
const int32_t flags = AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED;
const int32_t edgeFlags = AMOTION_EVENT_EDGE_FLAG_TOP;
const int32_t metaState = AMETA_ALT_LEFT_ON | AMETA_ALT_ON;
@@ -163,8 +164,8 @@ void InputPublisherAndConsumerTest::PublishAndConsumeMotionEvent() {
pointerCoords[i].setAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, 3.5 * i);
}
- status = mPublisher->publishMotionEvent(seq, deviceId, source, action, flags, edgeFlags,
- metaState, buttonState, xOffset, yOffset, xPrecision, yPrecision,
+ status = mPublisher->publishMotionEvent(seq, deviceId, source, action, actionButton,
+ flags, edgeFlags, metaState, buttonState, xOffset, yOffset, xPrecision, yPrecision,
downTime, eventTime, pointerCount,
pointerProperties, pointerCoords);
ASSERT_EQ(OK, status)
@@ -255,7 +256,7 @@ TEST_F(InputPublisherAndConsumerTest, PublishMotionEvent_WhenPointerCountLessTha
PointerProperties pointerProperties[pointerCount];
PointerCoords pointerCoords[pointerCount];
- status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
pointerCount, pointerProperties, pointerCoords);
ASSERT_EQ(BAD_VALUE, status)
<< "publisher publishMotionEvent should return BAD_VALUE";
@@ -271,7 +272,7 @@ TEST_F(InputPublisherAndConsumerTest, PublishMotionEvent_WhenPointerCountGreater
pointerCoords[i].clear();
}
- status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ status = mPublisher->publishMotionEvent(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
pointerCount, pointerProperties, pointerCoords);
ASSERT_EQ(BAD_VALUE, status)
<< "publisher publishMotionEvent should return BAD_VALUE";
diff --git a/libs/input/tests/StructLayout_test.cpp b/libs/input/tests/StructLayout_test.cpp
index 83bc6ae..8d73f45 100644
--- a/libs/input/tests/StructLayout_test.cpp
+++ b/libs/input/tests/StructLayout_test.cpp
@@ -51,10 +51,11 @@ void TestInputMessageAlignment() {
CHECK_OFFSET(InputMessage::Body::Motion, deviceId, 16);
CHECK_OFFSET(InputMessage::Body::Motion, source, 20);
CHECK_OFFSET(InputMessage::Body::Motion, action, 24);
- CHECK_OFFSET(InputMessage::Body::Motion, flags, 28);
- CHECK_OFFSET(InputMessage::Body::Motion, metaState, 32);
- CHECK_OFFSET(InputMessage::Body::Motion, buttonState, 36);
- CHECK_OFFSET(InputMessage::Body::Motion, edgeFlags, 40);
+ CHECK_OFFSET(InputMessage::Body::Motion, actionButton, 28);
+ CHECK_OFFSET(InputMessage::Body::Motion, flags, 32);
+ CHECK_OFFSET(InputMessage::Body::Motion, metaState, 36);
+ CHECK_OFFSET(InputMessage::Body::Motion, buttonState, 40);
+ CHECK_OFFSET(InputMessage::Body::Motion, edgeFlags, 44);
CHECK_OFFSET(InputMessage::Body::Motion, downTime, 48);
CHECK_OFFSET(InputMessage::Body::Motion, xOffset, 56);
CHECK_OFFSET(InputMessage::Body::Motion, yOffset, 60);