blob: 221b1a13644deed349b5147e7b96740edef83b96 [file] [log] [blame]
Lakshman Annadorai774ba782020-10-30 10:20:41 -07001/**
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_MOCKIOOVERUSEMONITOR_H_
18#define CPP_WATCHDOG_SERVER_TESTS_MOCKIOOVERUSEMONITOR_H_
19
20#include "IoOveruseMonitor.h"
Lakshman Annadorai965ef6d2021-02-24 16:37:05 -080021#include "MockDataProcessor.h"
Lakshman Annadorai774ba782020-10-30 10:20:41 -070022
23#include <android-base/result.h>
24#include <android/automotive/watchdog/internal/ComponentType.h>
25#include <android/automotive/watchdog/internal/IoOveruseConfiguration.h>
26#include <gmock/gmock.h>
27
28namespace android {
29namespace automotive {
30namespace watchdog {
31
Lakshman Annadorai965ef6d2021-02-24 16:37:05 -080032class MockIoOveruseMonitor : public MockDataProcessor, public IIoOveruseMonitor {
Lakshman Annadorai774ba782020-10-30 10:20:41 -070033public:
Lakshman Annadorai965ef6d2021-02-24 16:37:05 -080034 MockIoOveruseMonitor() {
35 ON_CALL(*this, name()).WillByDefault(::testing::Return("MockIoOveruseMonitor"));
36 }
Lakshman Annadorai774ba782020-10-30 10:20:41 -070037 ~MockIoOveruseMonitor() {}
Lakshman Annadoraid1426502021-04-06 20:06:58 -070038 MOCK_METHOD(android::base::Result<void>, updateResourceOveruseConfigurations,
39 (const std::vector<
40 android::automotive::watchdog::internal::ResourceOveruseConfiguration>&),
Lakshman Annadorai774ba782020-10-30 10:20:41 -070041 (override));
Lakshman Annadoraibc0afd02021-04-06 20:23:39 -070042 MOCK_METHOD(
43 android::base::Result<void>, getResourceOveruseConfigurations,
44 (std::vector<android::automotive::watchdog::internal::ResourceOveruseConfiguration>*),
45 (override));
Lakshman Annadorai9ed47322021-03-11 16:09:28 -080046 MOCK_METHOD(android::base::Result<void>, actionTakenOnIoOveruse,
47 (const std::vector<
48 android::automotive::watchdog::internal::PackageResourceOveruseAction>&
49 actions),
50 (override));
Lakshman Annadorai965ef6d2021-02-24 16:37:05 -080051 MOCK_METHOD(android::base::Result<void>, addIoOveruseListener,
52 (const sp<IResourceOveruseListener>&), (override));
53 MOCK_METHOD(android::base::Result<void>, removeIoOveruseListener,
54 (const sp<IResourceOveruseListener>&), (override));
55 MOCK_METHOD(android::base::Result<void>, getIoOveruseStats, (IoOveruseStats*), (override));
Lakshman Annadorai774ba782020-10-30 10:20:41 -070056};
57
58} // namespace watchdog
59} // namespace automotive
60} // namespace android
61
62#endif // CPP_WATCHDOG_SERVER_TESTS_MOCKIOOVERUSEMONITOR_H_