1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef TEST_UNITTEST_CORE_EVENT_EVENT_MANAGER_TEST_NG_H 17 #define TEST_UNITTEST_CORE_EVENT_EVENT_MANAGER_TEST_NG_H 18 #include <list> 19 #include <string> 20 #include <utility> 21 #include <vector> 22 23 #include "gtest/gtest.h" 24 25 #define private public 26 #define protected public 27 #include "mock_touch_event_target.h" 28 #include "test/mock/base/mock_task_executor.h" 29 #include "test/mock/core/common/mock_container.h" 30 31 #include "base/geometry/ng/offset_t.h" 32 #include "base/geometry/offset.h" 33 #include "base/geometry/point.h" 34 #include "base/geometry/rect.h" 35 #include "base/log/log_wrapper.h" 36 #include "base/memory/ace_type.h" 37 #include "base/memory/referenced.h" 38 #include "core/common/ace_engine.h" 39 #include "core/components/ability_component/ability_component.h" 40 #include "core/components/ability_component/render_ability_component.h" 41 #include "core/components/box/render_box.h" 42 #include "core/components/common/layout/constants.h" 43 #include "core/components_ng/base/frame_node.h" 44 #include "core/components_ng/event/focus_hub.h" 45 #include "core/components_ng/gestures/recognizers/gesture_recognizer.h" 46 #include "core/components_ng/gestures/recognizers/swipe_recognizer.h" 47 #include "core/components_ng/manager/select_overlay/select_overlay_manager.h" 48 #include "core/components_ng/pattern/button/button_event_hub.h" 49 #include "core/components_v2/inspector/inspector_constants.h" 50 #include "core/event/ace_events.h" 51 #include "core/event/axis_event.h" 52 #include "core/event/key_event.h" 53 #include "core/event/mouse_event.h" 54 #include "core/event/touch_event.h" 55 #include "core/pipeline/base/element_register.h" 56 #include "core/pipeline/pipeline_context.h" 57 #include "core/pipeline_ng/pipeline_context.h" 58 #include "frameworks/core/animation/animatable_properties.h" 59 #include "frameworks/core/common/event_manager.h" 60 #include "frameworks/core/common/font_manager.h" 61 #include "frameworks/core/common/manager_interface.h" 62 #include "frameworks/core/components_ng/pattern/stage/page_pattern.h" 63 64 namespace OHOS::Ace::NG { 65 namespace { 66 const std::string CTRL = "Ctrl"; 67 const std::string SHIFT = "shift"; 68 const std::string ALT = "alt"; 69 const std::string CTRLSHIFT = "Ctrl + shift"; 70 const std::string MOUSE = "mouse"; 71 const std::string MOUSE_EVENT = "mouse_event"; 72 const std::string MOUSE_EVENT_2 = "mouse_event_2"; 73 74 const std::string CHARACTER_C = "C"; 75 const std::string CHARACTER_A = "A"; 76 const std::string CHARACTER_V = "V"; 77 const std::string CHARACTER_Z = "Z"; 78 const std::string CHARACTER_EIGHT = "8"; 79 const std::string CHARACTER_X = "X"; 80 81 const std::string SHORT_CUT_VALUE_X = "X"; 82 const std::string SHORT_CUT_VALUE_Y = "Y"; 83 const std::string SHORT_CUT_VALUE_Z = "Z"; 84 const std::string SHORT_CUT_VALUE_A = "A"; 85 const std::string SHORT_CUT_VALUE_C = "C"; 86 const std::string SHORT_CUT_VALUE_V = "V"; 87 88 constexpr int32_t NUM_CTRL_VALUE = 1; 89 constexpr int32_t NUM_SHIFT_VALUE = 2; 90 constexpr int32_t NUM_ALT_VALUE = 4; 91 92 constexpr int32_t NODEID = 1; 93 constexpr int32_t NODEID_2 = 2; 94 constexpr int32_t NODEID_3 = 3; 95 96 enum class CtrlKeysBit { 97 CTRL = 1, 98 SHIFT = 2, 99 ALT = 4, 100 }; 101 102 RefPtr<MockTaskExecutor> MOCK_TASK_EXECUTOR; 103 const int32_t CONTAINER_INSTANCE_ID = 777; 104 } // namespace 105 106 class EventManagerTestNg : public testing::Test { 107 public: 108 static void SetUpTestSuite(); 109 static void TearDownTestSuite(); 110 }; 111 } // namespace OHOS::Ace::NG 112 113 #endif //TEST_UNITTEST_CORE_EVENT_EVENT_MANAGER_TEST_NG_H