1 /* 2 * Copyright (c) 2025 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 #ifndef INPUT_DEVICE_MGR_TEST_H 16 #define INPUT_DEVICE_MGR_TEST_H 17 18 #include <gtest/gtest.h> 19 20 #include <fcntl.h> 21 #include <gtest/gtest.h> 22 #include <memory> 23 #include <string> 24 25 #include "nocopyable.h" 26 27 #include "cooperate_events.h" 28 #include "delegate_tasks.h" 29 #include "device_manager.h" 30 #include "devicestatus_define.h" 31 #include "devicestatus_delayed_sp_singleton.h" 32 #include "drag_manager.h" 33 #include "i_context.h" 34 #include "timer_manager.h" 35 36 #include "intention_service.h" 37 #include "socket_session_manager.h" 38 39 namespace OHOS { 40 namespace Msdp { 41 namespace DeviceStatus { 42 class ContextService final : public IContext { 43 ContextService(); 44 ~ContextService(); 45 DISALLOW_COPY_AND_MOVE(ContextService); 46 public: 47 IDelegateTasks& GetDelegateTasks() override; 48 IDeviceManager& GetDeviceManager() override; 49 ITimerManager& GetTimerManager() override; 50 IDragManager& GetDragManager() override; 51 IDDMAdapter& GetDDM() override; 52 IPluginManager& GetPluginManager() override; 53 ISocketSessionManager& GetSocketSessionManager() override; 54 IInputAdapter& GetInput() override; 55 IDSoftbusAdapter& GetDSoftbus() override; 56 static ContextService* GetInstance(); 57 DeviceManager devMgr_; 58 }; 59 60 class InputDeviceMgrTest : public testing::Test { 61 public: 62 static void SetUpTestCase(); 63 void SetUp(); 64 void TearDown(); 65 void SetIContext(IContext *context); 66 void NotifyCooperate(); 67 void CheckInHot(); 68 void OnThreeStates(const Cooperate::CooperateEvent &event); 69 }; 70 } // namespace DeviceStatus 71 } // namespace Msdp 72 } // namespace OHOS 73 #endif // INPUT_DEVICE_MGR_TEST_H