1 /*
2  * Copyright (C) 2016 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 WIFICOND_TEST_MOCK_NETLINK_UTILS_H_
18 #define WIFICOND_TEST_MOCK_NETLINK_UTILS_H_
19 
20 #include <gmock/gmock.h>
21 
22 #include "wificond/net/netlink_utils.h"
23 
24 namespace android {
25 namespace wificond {
26 
27 class MockNetlinkUtils : public NetlinkUtils {
28  public:
29   MockNetlinkUtils(NetlinkManager* netlink_manager);
30   ~MockNetlinkUtils() override = default;
31 
32   MOCK_METHOD1(GetWiphyIndex, bool(uint32_t* out_wiphy_index));
33   MOCK_METHOD1(UnsubscribeMlmeEvent, void(uint32_t interface_index));
34   MOCK_METHOD1(UnsubscribeRegDomainChange, void(uint32_t wiphy_index));
35   MOCK_METHOD1(UnsubscribeStationEvent, void(uint32_t interface_index));
36   MOCK_METHOD2(SetInterfaceMode,
37                bool(uint32_t interface_index, InterfaceMode mode));
38   MOCK_METHOD2(SubscribeMlmeEvent,
39                void(uint32_t interface_index,
40                     MlmeEventHandler* handler));
41   MOCK_METHOD2(SubscribeRegDomainChange,
42                void(uint32_t wiphy_index,
43                     OnRegDomainChangedHandler handler));
44   MOCK_METHOD2(SubscribeStationEvent,
45                void(uint32_t interface_index,
46                     OnStationEventHandler handler));
47 
48   MOCK_METHOD2(GetInterfaces,
49                bool(uint32_t wiphy_index,
50                     std::vector<InterfaceInfo>* interfaces));
51   MOCK_METHOD4(GetWiphyInfo,
52                bool(uint32_t wiphy_index,
53                     BandInfo* band_info,
54                     ScanCapabilities* scan_capabilities,
55                     WiphyFeatures* wiphy_features));
56 
57 };  // class MockNetlinkUtils
58 
59 }  // namespace wificond
60 }  // namespace android
61 
62 #endif  // WIFICOND_TEST_MOCK_NETLINK_UTILS_H
63