7 class MockDeviceImpl : public IDevice {
12 bool click(const int x, const int y) override;
13 bool click(const int x, const int y, const unsigned int intv) override;
15 bool drag(const int sx, const int sy, const int ex, const int ey,
16 const int steps, const int durationMs) override;
18 int touchDown(const int x, const int y) override;
19 bool touchMove(const int x, const int y, const int seq) override;
20 bool touchUp(const int x, const int y, const int seq) override;
22 bool wheelUp(int amount, const int durationMs) override;
23 bool wheelDown(int amount, const int durationMs) override;
25 bool pressBack(KeyRequestType type) override;
26 bool pressHome(KeyRequestType type) override;
27 bool pressMenu(KeyRequestType type) override;
28 bool pressVolUp(KeyRequestType type) override;
29 bool pressVolDown(KeyRequestType type) override;
30 bool pressPower(KeyRequestType type) override;
31 bool pressKeyCode(std::string keycode, KeyRequestType type) override;
32 bool takeScreenshot(std::string path, float scale, int quality) override;
33 long long getSystemTime(TimeRequestType type) override;
36 bool strokeKeyCode(std::string keycode, unsigned int intv);
37 bool pressKeyCode(std::string keycode);
38 bool releaseKeyCode(std::string keycode);
40 int grabTouchSeqNumber();
41 bool releaseTouchSeqNumber(int seq);
44 void startTimer(void);
48 static const unsigned int INTV_CLICK = 5;
49 static const unsigned int INTV_SHORTSTROKE = 100;
50 static const unsigned int INTV_LONGSTROKE = 2000;
52 static const unsigned int INTV_MINIMUM_DRAG_MS = 25;
53 static const unsigned int INTV_MINIMUM_USLEEP = 1000;
54 static const unsigned int MINIMUM_DURATION_DRAG = 100;
55 static const unsigned int MSEC_PER_SEC = 1000;
56 static const unsigned int MAX_FINGER_NUMBER = 2;
58 struct timespec tStart;
61 std::set<int> mTouchSeq;