1 /* 2 * Copyright (c) 2021 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TEST_UNITTEST_MOCK_MOCK_RENDER_COMMON_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TEST_UNITTEST_MOCK_MOCK_RENDER_COMMON_H 18 19 #ifndef OHOS_STANDARD_SYSTEM 20 #include "adapter/aosp/entrance/java/jni/ace_application_info.h" 21 #include "adapter/aosp/entrance/java/jni/jni_environment.h" 22 #endif 23 #include "core/common/window.h" 24 #include "core/components/root/render_root.h" 25 26 namespace OHOS::Ace { 27 28 class MockWindow final : public PlatformWindow { 29 public: MockWindow(AceView * aceView)30 explicit MockWindow(AceView* aceView) {} 31 ~MockWindow() override = default; 32 33 // Platform window interface RequestFrame()34 void RequestFrame() override {} RegisterVsyncCallback(AceVsyncCallback && callback)35 void RegisterVsyncCallback(AceVsyncCallback&& callback) override {} SetRootRenderNode(const RefPtr<RenderNode> & root)36 void SetRootRenderNode(const RefPtr<RenderNode>& root) override {} 37 38 private: 39 ACE_DISALLOW_COPY_AND_MOVE(MockWindow); 40 }; 41 42 class MockRenderCommon { 43 public: 44 static RefPtr<PipelineContext> GetMockContext(); 45 }; 46 47 } // namespace OHOS::Ace 48 49 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_TEST_UNITTEST_MOCK_MOCK_RENDER_COMMON_H 50