• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2020, 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 #ifndef CPP_WATCHDOG_SERVER_TESTS_MOCKWATCHDOGPERFSERVICE_H_
18 #define CPP_WATCHDOG_SERVER_TESTS_MOCKWATCHDOGPERFSERVICE_H_
19 
20 #include "WatchdogPerfService.h"
21 
22 #include <android-base/result.h>
23 #include <android/automotive/watchdog/internal/UserState.h>
24 #include <gmock/gmock.h>
25 #include <utils/String16.h>
26 #include <utils/Vector.h>
27 
28 namespace android {
29 namespace automotive {
30 namespace watchdog {
31 
32 class MockWatchdogPerfService : public WatchdogPerfServiceInterface {
33 public:
MockWatchdogPerfService()34     MockWatchdogPerfService() {}
~MockWatchdogPerfService()35     ~MockWatchdogPerfService() {}
36     MOCK_METHOD(android::base::Result<void>, registerDataProcessor,
37                 (android::sp<DataProcessorInterface>), (override));
38     MOCK_METHOD(android::base::Result<void>, start, (), (override));
39     MOCK_METHOD(void, terminate, (), (override));
40     MOCK_METHOD(void, setSystemState, (SystemState), (override));
41     MOCK_METHOD(android::base::Result<void>, onBootFinished, (), (override));
42     MOCK_METHOD(android::base::Result<void>, onUserStateChange,
43                 (userid_t userId,
44                  const android::automotive::watchdog::internal::UserState& userState),
45                 (override));
46     MOCK_METHOD(android::base::Result<void>, onSuspendExit, (), (override));
47     MOCK_METHOD(android::base::Result<void>, onShutdownEnter, (), (override));
48     MOCK_METHOD(android::base::Result<void>, onCustomCollection,
49                 (int fd, const Vector<android::String16>& args), (override));
50     MOCK_METHOD(android::base::Result<void>, onDump, (int fd), (const, override));
51     MOCK_METHOD(bool, dumpHelpText, (int fd), (const, override));
52     MOCK_METHOD(void, handleMessage, (const Message&), (override));
53 };
54 
55 }  // namespace watchdog
56 }  // namespace automotive
57 }  // namespace android
58 
59 #endif  //  CPP_WATCHDOG_SERVER_TESTS_MOCKWATCHDOGPERFSERVICE_H_
60