• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3  * Copyright (c) 2024 Huawei Device Co., Ltd.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef HOT_AREA_TEST_H
18 #define HOT_AREA_TEST_H
19 
20 #include <gtest/gtest.h>
21 
22 #include <fcntl.h>
23 #include <gtest/gtest.h>
24 #include <memory>
25 #include <string>
26 
27 #include "nocopyable.h"
28 
29 #include "cooperate_events.h"
30 #include "delegate_tasks.h"
31 #include "device_manager.h"
32 #include "devicestatus_define.h"
33 #include "devicestatus_delayed_sp_singleton.h"
34 #include "drag_manager.h"
35 #include "i_context.h"
36 #include "timer_manager.h"
37 
38 #include "intention_service.h"
39 #include "socket_session_manager.h"
40 
41 namespace OHOS {
42 namespace Msdp {
43 namespace DeviceStatus {
44 class ContextService final : public IContext {
45     ContextService();
46     ~ContextService();
47     DISALLOW_COPY_AND_MOVE(ContextService);
48 public:
49     IDelegateTasks& GetDelegateTasks() override;
50     IDeviceManager& GetDeviceManager() override;
51     ITimerManager& GetTimerManager() override;
52     IDragManager& GetDragManager() override;
53     IDDMAdapter& GetDDM() override;
54     IPluginManager& GetPluginManager() override;
55     ISocketSessionManager& GetSocketSessionManager() override;
56     IInputAdapter& GetInput() override;
57     IDSoftbusAdapter& GetDSoftbus() override;
58     static ContextService* GetInstance();
59     DeviceManager devMgr_;
60 };
61 
62 class HotAreaTest : public testing::Test {
63 public:
64     static void SetUpTestCase();
65     void SetUp();
66     void TearDown();
67     void SetIContext(IContext *context);
68     MMI::PointerEvent::PointerItem CreatePointerItem(int32_t pointerId, int32_t deviceId,
69     const std::pair<int32_t, int32_t> &displayLocation, bool isPressed);
70     void NotifyCooperate();
71     void CheckInHot();
72     void OnThreeStates(const Cooperate::CooperateEvent &event);
73 };
74 } // namespace DeviceStatus
75 } // namespace Msdp
76 } // namespace OHOS
77 #endif // HOT_AREA_TEST_H