Ease selection dragging between large/small text lines
[chromium-blink-merge.git] / ppapi / tests / test_input_event.h
blob1e5aeea160cf3e26613d9091b54fb2711d2d632a
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_TESTS_TEST_INPUT_EVENT_H_
6 #define PPAPI_TESTS_TEST_INPUT_EVENT_H_
8 #include <string>
9 #include <vector>
11 #include "ppapi/c/ppb_input_event.h"
12 #include "ppapi/c/private/ppb_testing_private.h"
13 #include "ppapi/cpp/input_event.h"
14 #include "ppapi/cpp/point.h"
15 #include "ppapi/cpp/private/input_event_private.h"
16 #include "ppapi/cpp/rect.h"
17 #include "ppapi/tests/test_case.h"
18 #include "ppapi/tests/test_utils.h"
20 class TestInputEvent : public TestCase {
21 public:
22 explicit TestInputEvent(TestingInstance* instance);
23 ~TestInputEvent();
25 virtual bool HandleInputEvent(const pp::InputEvent& input_event);
26 virtual void HandleMessage(const pp::Var& message_data);
27 virtual void DidChangeView(const pp::View& view);
29 // TestCase implementation.
30 virtual bool Init();
31 virtual void RunTests(const std::string& test_filter);
33 private:
34 pp::InputEvent CreateMouseEvent(PP_InputEvent_Type type,
35 PP_InputEvent_MouseButton buttons);
36 pp::InputEvent CreateWheelEvent();
37 pp::InputEvent CreateKeyEvent(PP_InputEvent_Type type,
38 uint32_t key_code, const std::string& code);
39 pp::InputEvent CreateCharEvent(const std::string& text);
40 pp::InputEvent CreateTouchEvent(PP_InputEvent_Type type,
41 const pp::FloatPoint& location);
43 void PostMessageBarrier();
44 bool SimulateInputEvent(const pp::InputEvent& input_event);
45 bool AreEquivalentEvents(PP_Resource first, PP_Resource second);
47 std::string TestEvents();
48 std::string TestEventsLatencyTracking();
49 std::string TestAcceptTouchEvent_1();
50 std::string TestAcceptTouchEvent_2();
51 std::string TestAcceptTouchEvent_3();
52 std::string TestAcceptTouchEvent_4();
54 const PPB_InputEvent* input_event_interface_;
55 const PPB_InputEvent_Private* input_event_private_interface_;
56 const PPB_MouseInputEvent* mouse_input_event_interface_;
57 const PPB_WheelInputEvent* wheel_input_event_interface_;
58 const PPB_KeyboardInputEvent* keyboard_input_event_interface_;
59 const PPB_TouchInputEvent* touch_input_event_interface_;
61 NestedEvent nested_event_;
63 pp::Rect view_rect_;
64 pp::InputEvent expected_input_event_;
65 bool received_expected_event_;
66 bool received_finish_message_;
67 bool enable_latency_tracking_;
68 bool last_latency_tracking_successful_;
71 #endif // PPAPI_TESTS_TEST_INPUT_EVENT_H_