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 FRAMEWORKS_FENCE_TEST_UNITTEST_FD_TEST_H
17 #define FRAMEWORKS_FENCE_TEST_UNITTEST_FD_TEST_H
18 
19 #include <iostream>
20 
21 #include <gtest/gtest.h>
22 
23 #include <surface.h>
24 #include "fence.h"
25 #include "iconsumer_surface.h"
26 
27 namespace OHOS {
28 class FenceFdTest : public testing::Test, public IBufferConsumerListenerClazz {
29 public:
30     static void SetUpTestCase();
31     static void TearDownTestCase();
32 
33     virtual void OnBufferAvailable() override;
34 
35     static inline BufferRequestConfig requestConfig = {
36         .width = 0x100,
37         .height = 0x100,
38         .strideAlignment = 0x8,
39         .format = GRAPHIC_PIXEL_FMT_RGBA_8888,
40         .usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA,
41         .timeout = 0,
42     };
43     static inline BufferFlushConfig flushConfig = {
44         .damage = { .w = 0x100, .h = 0x100, },
45     };
46     static inline int64_t timestamp = 0;
47     static inline Rect damage = {};
48     static inline sptr<IConsumerSurface> csurf = nullptr;
49     static inline sptr<IBufferProducer> producer = nullptr;
50     static inline sptr<Surface> psurf = nullptr;
51 };
52 } // namespace OHOS
53 
54 #endif // FRAMEWORKS_FENCE_TEST_UNITTEST_FD_TEST_H
55