• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <gmock/gmock.h>
20 
21 #include "SurfaceInterceptor.h"
22 
23 namespace android::mock {
24 
25 class SurfaceInterceptor : public android::SurfaceInterceptor {
26 public:
27     SurfaceInterceptor();
28     ~SurfaceInterceptor() override;
29 
30     MOCK_METHOD2(enable,
31                  void(const SortedVector<sp<Layer>>&,
32                       const DefaultKeyedVector<wp<IBinder>, DisplayDeviceState>&));
33     MOCK_METHOD0(disable, void());
34     MOCK_METHOD0(isEnabled, bool());
35     MOCK_METHOD1(addTransactionTraceListener, void(const sp<gui::ITransactionTraceListener>&));
36     MOCK_METHOD1(binderDied, void(const wp<IBinder>&));
37     MOCK_METHOD7(saveTransaction,
38                  void(const Vector<ComposerState>&,
39                       const DefaultKeyedVector<wp<IBinder>, DisplayDeviceState>&,
40                       const Vector<DisplayState>&, uint32_t, int, int, uint64_t));
41     MOCK_METHOD1(saveSurfaceCreation, void(const sp<const Layer>&));
42     MOCK_METHOD1(saveSurfaceDeletion, void(const sp<const Layer>&));
43     MOCK_METHOD4(saveBufferUpdate, void(int32_t, uint32_t, uint32_t, uint64_t));
44     MOCK_METHOD1(saveDisplayCreation, void(const DisplayDeviceState&));
45     MOCK_METHOD1(saveDisplayDeletion, void(int32_t));
46     MOCK_METHOD2(savePowerModeUpdate, void(int32_t, int32_t));
47     MOCK_METHOD1(saveVSyncEvent, void(nsecs_t));
48 };
49 
50 } // namespace android::mock
51