1 /* 2 * Copyright (c) 2022 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_BASE_TEST_MOCK_MOCK_PIXEL_MAP_H 17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_PIXEL_MAP_H 18 19 #include "gmock/gmock.h" 20 21 #include "base/image/pixel_map.h" 22 23 namespace OHOS::Ace { 24 class MockPixelMap : public PixelMap { 25 DECLARE_ACE_TYPE(MockPixelMap, PixelMap); 26 27 public: 28 MockPixelMap() = default; 29 ~MockPixelMap() override = default; 30 31 int32_t GetWidth() const override; 32 int32_t GetHeight() const override; 33 MOCK_CONST_METHOD0(GetPixels, const uint8_t*()); 34 MOCK_CONST_METHOD0(GetPixelFormat, PixelFormat()); 35 MOCK_CONST_METHOD0(GetAlphaType, AlphaType()); 36 MOCK_CONST_METHOD0(GetRowBytes, int32_t()); 37 MOCK_CONST_METHOD0(GetByteCount, int32_t()); 38 MOCK_CONST_METHOD0(GetPixelManager, void*()); 39 MOCK_CONST_METHOD0(GetRawPixelMapPtr, void*()); 40 MOCK_METHOD0(GetId, std::string()); 41 MOCK_METHOD0(GetModifyId, std::string()); 42 }; 43 } // namespace OHOS::Ace 44 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_TEST_MOCK_MOCK_PIXEL_MAP_H 45