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 INPUT_EVENT_INTERCEPTOR_TEST_H 17 #define INPUT_EVENT_INTERCEPTOR_TEST_H 18 19 #include <gtest/gtest.h> 20 21 #include "cooperate_context.h" 22 #include "delegate_tasks.h" 23 #include "device_manager.h" 24 #include "drag_manager.h" 25 #include "dsoftbus_adapter.h" 26 #include "i_context.h" 27 #include "input_adapter.h" 28 #include "input_event_interceptor.h" 29 #include "input_event_serialization.h" 30 #include "timer_manager.h" 31 32 #include "intention_service.h" 33 #include "socket_session_manager.h" 34 35 namespace OHOS { 36 namespace Msdp { 37 namespace DeviceStatus { 38 namespace Cooperate { 39 class ContextService final : public IContext { 40 ContextService(); 41 ~ContextService(); 42 DISALLOW_COPY_AND_MOVE(ContextService); 43 public: 44 IDelegateTasks& GetDelegateTasks() override; 45 IDeviceManager& GetDeviceManager() override; 46 ITimerManager& GetTimerManager() override; 47 IDragManager& GetDragManager() override; 48 IDDMAdapter& GetDDM() override; 49 IPluginManager& GetPluginManager() override; 50 ISocketSessionManager& GetSocketSessionManager() override; 51 IInputAdapter& GetInput() override; 52 IDSoftbusAdapter& GetDSoftbus() override; 53 private: 54 static ContextService* GetInstance(); 55 DelegateTasks delegateTasks_; 56 DeviceManager devMgr_; 57 TimerManager timerMgr_; 58 DragManager dragMgr_; 59 std::unique_ptr<IDDMAdapter> ddm_; 60 }; 61 62 class InputEventInterceptorTest : public testing::Test { 63 public: 64 static void SetUpTestCase(); 65 static void TearDownTestCase(); 66 void SetUp(); 67 void TearDown(); 68 }; 69 } // namespace Cooperate 70 } // namespace DeviceStatus 71 } // namespace Msdp 72 } // namespace OHOS 73 #endif // INPUT_EVENT_INTERCEPTOR_TEST_H