1 /* 2 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development 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 OHOS_SHARING_MOCK_SHARING_ADAPTER_H 17 #define OHOS_SHARING_MOCK_SHARING_ADAPTER_H 18 19 #include <gmock/gmock.h> 20 #include "sharing_adapter.h" 21 22 namespace OHOS { 23 namespace Sharing { 24 25 class MockSharingAdapter : public ISharingAdapter { 26 public: ~MockSharingAdapter()27 ~MockSharingAdapter() 28 { 29 } 30 31 public: 32 MOCK_METHOD(void, ReleaseScene, (uint32_t sceneId)); 33 MOCK_METHOD(void, OnSceneNotifyDestroyed, (uint32_t sceneId)); 34 MOCK_METHOD(int32_t, ForwardEvent, (uint32_t contextId, uint32_t agentId, SharingEvent &event, bool isSync)); 35 MOCK_METHOD(void, ForwardDomainMsg, (std::shared_ptr<BaseDomainMsg> &msg)); 36 MOCK_METHOD(int32_t, CreateContext, (uint32_t &contextId)); 37 MOCK_METHOD(int32_t, CreateAgent, (uint32_t &contextId, uint32_t &agentId, AgentType agentType, 38 std::string sessionName)); 39 MOCK_METHOD(int32_t, DestroyContext, (uint32_t contextId)); 40 MOCK_METHOD(int32_t, DestroyAgent, (uint32_t contextId, uint32_t agentId)); 41 MOCK_METHOD(int32_t, Stop, (uint32_t contextId, uint32_t agentId)); 42 MOCK_METHOD(int32_t, Start, (uint32_t contextId, uint32_t agentId)); 43 MOCK_METHOD(int32_t, Pause, (uint32_t contextId, uint32_t agentId, MediaType mediaType)); 44 MOCK_METHOD(int32_t, Resume, (uint32_t contextId, uint32_t agentId, MediaType mediaType)); 45 MOCK_METHOD(int32_t, Play, (uint32_t contextId, uint32_t agentId)); 46 MOCK_METHOD(int32_t, Close, (uint32_t contextId, uint32_t agentId)); 47 MOCK_METHOD(int32_t, SetKeyPlay, (uint32_t contextId, uint32_t agentId, uint64_t surfaceId, bool keyFrame)); 48 MOCK_METHOD(int32_t, SetKeyRedirect, (uint32_t contextId, uint32_t agentId, uint64_t surfaceId, bool keyRedirect)); 49 MOCK_METHOD(int32_t, SetVolume, (uint32_t contextId, uint32_t agentId, float volume)); 50 MOCK_METHOD(int32_t, AppendSurface, (uint32_t contextId, uint32_t agentId, sptr<Surface> surface, 51 SceneType sceneType)); 52 MOCK_METHOD(int32_t, RemoveSurface, (uint32_t contextId, uint32_t agentId, uint64_t surfaceId)); 53 MOCK_METHOD(int32_t, DestroyWindow, (int32_t windowId)); 54 MOCK_METHOD(int32_t, CreateWindow, (int32_t &windowId, WindowProperty &windowProperty)); 55 MOCK_METHOD(int32_t, Hide, (int32_t windowId)); 56 MOCK_METHOD(int32_t, Show, (int32_t windowId)); 57 MOCK_METHOD(int32_t, SetFullScreen, (int32_t windowId, bool isFull)); 58 MOCK_METHOD(int32_t, MoveTo, (int32_t windowId, int32_t x, int32_t y)); 59 MOCK_METHOD(int32_t, GetSurface, (int32_t windowId, sptr<Surface> &surface)); 60 MOCK_METHOD(int32_t, ReSize, (int32_t windowId, int32_t width, int32_t height)); 61 }; 62 63 } // namespace Sharing 64 } // namespace OHOS 65 #endif 66