| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PPAPI_TESTS_TEST_INPUT_EVENT_H_ | 5 #ifndef PPAPI_TESTS_TEST_INPUT_EVENT_H_ |
| 6 #define PPAPI_TESTS_TEST_INPUT_EVENT_H_ | 6 #define PPAPI_TESTS_TEST_INPUT_EVENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "ppapi/c/ppb_input_event.h" | 11 #include "ppapi/c/ppb_input_event.h" |
| 12 #include "ppapi/c/private/ppb_testing_private.h" | 12 #include "ppapi/c/private/ppb_testing_private.h" |
| 13 #include "ppapi/cpp/input_event.h" | 13 #include "ppapi/cpp/input_event.h" |
| 14 #include "ppapi/cpp/point.h" | 14 #include "ppapi/cpp/point.h" |
| 15 #include "ppapi/cpp/private/input_event_private.h" |
| 15 #include "ppapi/cpp/rect.h" | 16 #include "ppapi/cpp/rect.h" |
| 16 #include "ppapi/tests/test_case.h" | 17 #include "ppapi/tests/test_case.h" |
| 17 #include "ppapi/tests/test_utils.h" | 18 #include "ppapi/tests/test_utils.h" |
| 18 | 19 |
| 19 class TestInputEvent : public TestCase { | 20 class TestInputEvent : public TestCase { |
| 20 public: | 21 public: |
| 21 explicit TestInputEvent(TestingInstance* instance); | 22 explicit TestInputEvent(TestingInstance* instance); |
| 22 ~TestInputEvent(); | 23 ~TestInputEvent(); |
| 23 | 24 |
| 24 virtual bool HandleInputEvent(const pp::InputEvent& input_event); | 25 virtual bool HandleInputEvent(const pp::InputEvent& input_event); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 37 uint32_t key_code, const std::string& code); | 38 uint32_t key_code, const std::string& code); |
| 38 pp::InputEvent CreateCharEvent(const std::string& text); | 39 pp::InputEvent CreateCharEvent(const std::string& text); |
| 39 pp::InputEvent CreateTouchEvent(PP_InputEvent_Type type, | 40 pp::InputEvent CreateTouchEvent(PP_InputEvent_Type type, |
| 40 const pp::FloatPoint& location); | 41 const pp::FloatPoint& location); |
| 41 | 42 |
| 42 void PostMessageBarrier(); | 43 void PostMessageBarrier(); |
| 43 bool SimulateInputEvent(const pp::InputEvent& input_event); | 44 bool SimulateInputEvent(const pp::InputEvent& input_event); |
| 44 bool AreEquivalentEvents(PP_Resource first, PP_Resource second); | 45 bool AreEquivalentEvents(PP_Resource first, PP_Resource second); |
| 45 | 46 |
| 46 std::string TestEvents(); | 47 std::string TestEvents(); |
| 48 std::string TestEventsLatencyTracking(); |
| 47 std::string TestAcceptTouchEvent_1(); | 49 std::string TestAcceptTouchEvent_1(); |
| 48 std::string TestAcceptTouchEvent_2(); | 50 std::string TestAcceptTouchEvent_2(); |
| 49 std::string TestAcceptTouchEvent_3(); | 51 std::string TestAcceptTouchEvent_3(); |
| 50 std::string TestAcceptTouchEvent_4(); | 52 std::string TestAcceptTouchEvent_4(); |
| 51 | 53 |
| 52 const PPB_InputEvent* input_event_interface_; | 54 const PPB_InputEvent* input_event_interface_; |
| 55 const PPB_InputEvent_Private* input_event_private_interface_; |
| 53 const PPB_MouseInputEvent* mouse_input_event_interface_; | 56 const PPB_MouseInputEvent* mouse_input_event_interface_; |
| 54 const PPB_WheelInputEvent* wheel_input_event_interface_; | 57 const PPB_WheelInputEvent* wheel_input_event_interface_; |
| 55 const PPB_KeyboardInputEvent* keyboard_input_event_interface_; | 58 const PPB_KeyboardInputEvent* keyboard_input_event_interface_; |
| 56 const PPB_TouchInputEvent* touch_input_event_interface_; | 59 const PPB_TouchInputEvent* touch_input_event_interface_; |
| 57 | 60 |
| 58 NestedEvent nested_event_; | 61 NestedEvent nested_event_; |
| 59 | 62 |
| 60 pp::Rect view_rect_; | 63 pp::Rect view_rect_; |
| 61 pp::InputEvent expected_input_event_; | 64 pp::InputEvent expected_input_event_; |
| 62 bool received_expected_event_; | 65 bool received_expected_event_; |
| 63 bool received_finish_message_; | 66 bool received_finish_message_; |
| 67 bool enable_latency_tracking_; |
| 68 bool last_latency_tracking_successful_; |
| 64 }; | 69 }; |
| 65 | 70 |
| 66 #endif // PPAPI_TESTS_TEST_INPUT_EVENT_H_ | 71 #endif // PPAPI_TESTS_TEST_INPUT_EVENT_H_ |
| OLD | NEW |