~macslow/qtmir/fix-1475678

« back to all changes in this revision

Viewing changes to tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp

  • Committer: Robert Carr
  • Date: 2015-02-19 23:03:14 UTC
  • mto: This revision was merged to the branch mainline in revision 326.
  • Revision ID: robert.carr@canonical.com-20150219230314-n0voojj2vfvj01kc
Port to MirEvent 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2014 Canonical, Ltd.
 
2
 * Copyright (C) 2014-2015 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it under
5
5
 * the terms of the GNU Lesser General Public License version 3, as published by
15
15
 *
16
16
 */
17
17
 
 
18
#define MIR_INCLUDE_DEPRECATED_EVENT_HEADER
 
19
 
18
20
#include <gmock/gmock.h>
19
21
#include <gtest/gtest.h>
20
22
 
191
193
    ASSERT_TRUE(Mock::VerifyAndClearExpectations(mockWindowSystem));
192
194
}
193
195
 
194
 
TEST_F(QtEventFeederTest, IgnoreHovering)
195
 
{
196
 
    setIrrelevantMockWindowSystemExpectations();
197
 
    EXPECT_CALL(*mockWindowSystem, handleTouchEvent(_,_,_,_)).Times(0);
198
 
 
199
 
    MirEvent mirEvent;
200
 
    mirEvent.type = mir_event_type_motion;
201
 
    mirEvent.motion.pointer_count = 1;
202
 
    mirEvent.motion.pointer_coordinates[0].id = 0;
203
 
    mirEvent.motion.pointer_coordinates[0].x = 10;
204
 
    mirEvent.motion.pointer_coordinates[0].y = 10;
205
 
    mirEvent.motion.pointer_coordinates[0].touch_major = 1;
206
 
    mirEvent.motion.pointer_coordinates[0].touch_minor = 1;
207
 
    mirEvent.motion.pointer_coordinates[0].pressure = 10;
208
 
    mirEvent.motion.action = mir_motion_action_hover_enter;
209
 
    mirEvent.motion.event_time = 123 * 1000000;
210
 
 
211
 
    qtEventFeeder->dispatch(mirEvent);
212
 
 
213
 
    mirEvent.motion.pointer_coordinates[0].x = 20;
214
 
    mirEvent.motion.pointer_coordinates[0].y = 20;
215
 
    mirEvent.motion.action = mir_motion_action_hover_move;
216
 
    mirEvent.motion.event_time = 125 * 1000000;
217
 
 
218
 
    qtEventFeeder->dispatch(mirEvent);
219
 
 
220
 
    mirEvent.motion.action = mir_motion_action_hover_exit;
221
 
    mirEvent.motion.event_time = 127 * 1000000;
222
 
 
223
 
    qtEventFeeder->dispatch(mirEvent);
224
 
}