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 TEST_UNITTEST_CORE_ACCESSIBILITY_ACCESSIBILITY_SESSION_ADAPTER_TEST_H 17 #define TEST_UNITTEST_CORE_ACCESSIBILITY_ACCESSIBILITY_SESSION_ADAPTER_TEST_H 18 19 #include "frameworks/core/accessibility/accessibility_session_adapter.h" 20 #include "frameworks/core/components_ng/pattern/pattern.h" 21 22 namespace OHOS::Ace::NG { 23 24 class MockAccessibilityTestPattern : public Pattern { 25 DECLARE_ACE_TYPE(MockAccessibilityTestPattern, Pattern); 26 27 public: MockAccessibilityTestPattern()28 MockAccessibilityTestPattern() 29 { 30 accessibilitySessionAdapter_ = AceType::MakeRefPtr<AccessibilitySessionAdapter>(); 31 } 32 33 ~MockAccessibilityTestPattern() override = default; 34 GetAccessibilitySessionAdapter()35 RefPtr<AccessibilitySessionAdapter> GetAccessibilitySessionAdapter() 36 { 37 return accessibilitySessionAdapter_; 38 } 39 40 private: 41 RefPtr<AccessibilitySessionAdapter> accessibilitySessionAdapter_; 42 ACE_DISALLOW_COPY_AND_MOVE(MockAccessibilityTestPattern); 43 }; 44 } // namespace OHOS::Ace::NG 45 46 #endif // TEST_UNITTEST_CORE_ACCESSIBILITY_ACCESSIBILITY_SESSION_ADAPTER_TEST_H