summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSohani Rao2017-07-25 20:09:57 -0500
committerSohani Rao2017-08-11 19:39:02 -0500
commit69f61f7fd15d44dd32a107d850f05f0eb933ab2c (patch)
treea5e12f0a4f59145729df067db16788f5c59b7997
parent64187ec9e8b48b4de5565e8ae1dbf2f2f3e859bd (diff)
downloadsystem-connectivity-wificond-69f61f7fd15d44dd32a107d850f05f0eb933ab2c.tar.gz
system-connectivity-wificond-69f61f7fd15d44dd32a107d850f05f0eb933ab2c.tar.xz
system-connectivity-wificond-69f61f7fd15d44dd32a107d850f05f0eb933ab2c.zip
Wificond: Create mocks of Offload Scan objects
Create objects for Offload HAL to enable testing of Scanner Impl Test: Unit tests Bug: 32842314 Change-Id: Iea881dbbef0f6dc53b87f8ea24acd3c3e347f902
-rw-r--r--Android.mk2
-rw-r--r--scanning/offload/offload_scan_manager.h7
-rw-r--r--scanning/offload/offload_service_utils.cpp12
-rw-r--r--scanning/offload/offload_service_utils.h9
-rw-r--r--scanning/scanner_impl.cpp7
-rw-r--r--scanning/scanner_impl.h6
-rw-r--r--tests/mock_offload_scan_callback_interface.h6
-rw-r--r--tests/mock_offload_scan_callback_interface_impl.cpp28
-rw-r--r--tests/mock_offload_scan_callback_interface_impl.h44
-rw-r--r--tests/mock_offload_scan_manager.cpp28
-rw-r--r--tests/mock_offload_scan_manager.h56
-rw-r--r--tests/mock_offload_service_utils.h9
-rw-r--r--tests/scanner_unittest.cpp13
13 files changed, 214 insertions, 13 deletions
diff --git a/Android.mk b/Android.mk
index fd42006..b25e39b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -177,6 +177,8 @@ LOCAL_SRC_FILES := \
177 tests/mock_offload.cpp \ 177 tests/mock_offload.cpp \
178 tests/mock_offload_callback_handlers.cpp \ 178 tests/mock_offload_callback_handlers.cpp \
179 tests/mock_offload_scan_callback_interface.cpp \ 179 tests/mock_offload_scan_callback_interface.cpp \
180 tests/mock_offload_scan_callback_interface_impl.cpp \
181 tests/mock_offload_scan_manager.cpp \
180 tests/mock_offload_service_utils.cpp \ 182 tests/mock_offload_service_utils.cpp \
181 tests/mock_scan_utils.cpp \ 183 tests/mock_scan_utils.cpp \
182 tests/netlink_manager_unittest.cpp \ 184 tests/netlink_manager_unittest.cpp \
diff --git a/scanning/offload/offload_scan_manager.h b/scanning/offload/offload_scan_manager.h
index 9cc3d47..46f1bad 100644
--- a/scanning/offload/offload_scan_manager.h
+++ b/scanning/offload/offload_scan_manager.h
@@ -19,8 +19,7 @@
19#include <android/hardware/wifi/offload/1.0/IOffload.h> 19#include <android/hardware/wifi/offload/1.0/IOffload.h>
20#include "wificond/scanning/offload/offload_callback.h" 20#include "wificond/scanning/offload/offload_callback.h"
21#include "wificond/scanning/offload/offload_callback_handlers.h" 21#include "wificond/scanning/offload/offload_callback_handlers.h"
22#include "wificond/scanning/offload/offload_service_utils.h" 22#include "wificond/scanning/offload_scan_callback_interface_impl.h"
23#include "wificond/scanning/offload_scan_callback_interface.h"
24 23
25#include <vector> 24#include <vector>
26 25
@@ -43,6 +42,8 @@ namespace android {
43namespace wificond { 42namespace wificond {
44 43
45class OffloadScanManager; 44class OffloadScanManager;
45class OffloadDeathRecipient;
46class OffloadServiceUtils;
46 47
47// Provides callback interface implementation from Offload HAL 48// Provides callback interface implementation from Offload HAL
48class OffloadCallbackHandlersImpl : public OffloadCallbackHandlers { 49class OffloadCallbackHandlersImpl : public OffloadCallbackHandlers {
@@ -148,7 +149,7 @@ class OffloadScanManager {
148 bool service_available_; 149 bool service_available_;
149 150
150 const std::weak_ptr<OffloadServiceUtils> offload_service_utils_; 151 const std::weak_ptr<OffloadServiceUtils> offload_service_utils_;
151 const std::unique_ptr<OffloadCallbackHandlersImpl> offload_callback_handlers_; 152 const std::shared_ptr<OffloadCallbackHandlersImpl> offload_callback_handlers_;
152 std::shared_ptr<OffloadScanCallbackInterface> event_callback_; 153 std::shared_ptr<OffloadScanCallbackInterface> event_callback_;
153 154
154 friend class OffloadCallbackHandlersImpl; 155 friend class OffloadCallbackHandlersImpl;
diff --git a/scanning/offload/offload_service_utils.cpp b/scanning/offload/offload_service_utils.cpp
index a4a2474..e7b7be8 100644
--- a/scanning/offload/offload_service_utils.cpp
+++ b/scanning/offload/offload_service_utils.cpp
@@ -18,6 +18,7 @@
18#include <android-base/logging.h> 18#include <android-base/logging.h>
19 19
20#include "wificond/scanning/offload/offload_scan_manager.h" 20#include "wificond/scanning/offload/offload_scan_manager.h"
21#include "wificond/scanning/scanner_impl.h"
21 22
22using ::android::hardware::wifi::offload::V1_0::IOffload; 23using ::android::hardware::wifi::offload::V1_0::IOffload;
23 24
@@ -47,6 +48,17 @@ bool OffloadServiceUtils::IsOffloadScanSupported() const {
47 return result; 48 return result;
48} 49}
49 50
51std::shared_ptr<OffloadScanCallbackInterfaceImpl>
52OffloadServiceUtils::GetOffloadScanCallbackInterface(ScannerImpl* parent) {
53 return std::make_shared<OffloadScanCallbackInterfaceImpl>(parent);
54}
55
56std::shared_ptr<OffloadScanManager> OffloadServiceUtils::GetOffloadScanManager(
57 std::weak_ptr<OffloadServiceUtils> service_utils,
58 std::shared_ptr<OffloadScanCallbackInterfaceImpl> callback_interface) {
59 return std::make_shared<OffloadScanManager>(service_utils, callback_interface);
60}
61
50OffloadDeathRecipient::OffloadDeathRecipient( 62OffloadDeathRecipient::OffloadDeathRecipient(
51 OffloadDeathRecipientHandler handler) 63 OffloadDeathRecipientHandler handler)
52 : handler_(handler) {} 64 : handler_(handler) {}
diff --git a/scanning/offload/offload_service_utils.h b/scanning/offload/offload_service_utils.h
index cff5575..42268de 100644
--- a/scanning/offload/offload_service_utils.h
+++ b/scanning/offload/offload_service_utils.h
@@ -19,11 +19,15 @@
19#include <android/hardware/wifi/offload/1.0/IOffload.h> 19#include <android/hardware/wifi/offload/1.0/IOffload.h>
20#include "wificond/scanning/offload/offload_callback.h" 20#include "wificond/scanning/offload/offload_callback.h"
21#include "wificond/scanning/offload/offload_callback_handlers.h" 21#include "wificond/scanning/offload/offload_callback_handlers.h"
22#include "wificond/scanning/offload_scan_callback_interface_impl.h"
22 23
23namespace android { 24namespace android {
24namespace wificond { 25namespace wificond {
25 26
26typedef std::function<void(uint64_t)> OffloadDeathRecipientHandler; 27typedef std::function<void(uint64_t)> OffloadDeathRecipientHandler;
28class ScannerImpl;
29class OffloadServiceUtils;
30class OffloadScanManager;
27 31
28class OffloadDeathRecipient : public android::hardware::hidl_death_recipient { 32class OffloadDeathRecipient : public android::hardware::hidl_death_recipient {
29 public: 33 public:
@@ -52,6 +56,11 @@ class OffloadServiceUtils {
52 OffloadCallbackHandlers* handlers); 56 OffloadCallbackHandlers* handlers);
53 virtual OffloadDeathRecipient* GetOffloadDeathRecipient( 57 virtual OffloadDeathRecipient* GetOffloadDeathRecipient(
54 OffloadDeathRecipientHandler handler); 58 OffloadDeathRecipientHandler handler);
59 virtual std::shared_ptr<OffloadScanCallbackInterfaceImpl>
60 GetOffloadScanCallbackInterface(ScannerImpl* parent);
61 virtual std::shared_ptr<OffloadScanManager> GetOffloadScanManager(
62 std::weak_ptr<OffloadServiceUtils> service_utils,
63 std::shared_ptr<OffloadScanCallbackInterfaceImpl> callback_interface);
55}; 64};
56 65
57} // namespace wificond 66} // namespace wificond
diff --git a/scanning/scanner_impl.cpp b/scanning/scanner_impl.cpp
index 308811a..5fa7093 100644
--- a/scanning/scanner_impl.cpp
+++ b/scanning/scanner_impl.cpp
@@ -80,10 +80,9 @@ ScannerImpl::ScannerImpl(uint32_t wiphy_index, uint32_t interface_index,
80 _1, _2)); 80 _1, _2));
81 std::shared_ptr<OffloadScanCallbackInterfaceImpl> 81 std::shared_ptr<OffloadScanCallbackInterfaceImpl>
82 offload_scan_callback_interface = 82 offload_scan_callback_interface =
83 std::make_shared<OffloadScanCallbackInterfaceImpl>( 83 offload_service_utils.lock()->GetOffloadScanCallbackInterface(this);
84 *(new OffloadScanCallbackInterfaceImpl(this))); 84 offload_scan_manager_ = offload_service_utils.lock()->GetOffloadScanManager(
85 offload_scan_manager_.reset(new OffloadScanManager( 85 offload_service_utils, offload_scan_callback_interface);
86 offload_service_utils, offload_scan_callback_interface));
87 offload_scan_supported_ = offload_service_utils.lock()->IsOffloadScanSupported(); 86 offload_scan_supported_ = offload_service_utils.lock()->IsOffloadScanSupported();
88} 87}
89 88
diff --git a/scanning/scanner_impl.h b/scanning/scanner_impl.h
index ff1d50f..8e1f832 100644
--- a/scanning/scanner_impl.h
+++ b/scanning/scanner_impl.h
@@ -24,9 +24,8 @@
24 24
25#include "android/net/wifi/BnWifiScannerImpl.h" 25#include "android/net/wifi/BnWifiScannerImpl.h"
26#include "wificond/net/netlink_utils.h" 26#include "wificond/net/netlink_utils.h"
27#include "wificond/scanning/offload/offload_scan_manager.h" 27#include "wificond/scanning/offload_scan_callback_interface.h"
28#include "wificond/scanning/scan_utils.h" 28#include "wificond/scanning/scan_utils.h"
29#include "wificond/scanning/offload_scan_callback_interface_impl.h"
30 29
31namespace android { 30namespace android {
32namespace wificond { 31namespace wificond {
@@ -35,6 +34,7 @@ class ClientInterfaceImpl;
35class OffloadServiceUtils; 34class OffloadServiceUtils;
36class ScanUtils; 35class ScanUtils;
37class OffloadScanCallbackInterfaceImpl; 36class OffloadScanCallbackInterfaceImpl;
37class OffloadScanManager;
38 38
39class ScannerImpl : public android::net::wifi::BnWifiScannerImpl { 39class ScannerImpl : public android::net::wifi::BnWifiScannerImpl {
40 public: 40 public:
@@ -128,7 +128,7 @@ class ScannerImpl : public android::net::wifi::BnWifiScannerImpl {
128 ScanUtils* const scan_utils_; 128 ScanUtils* const scan_utils_;
129 ::android::sp<::android::net::wifi::IPnoScanEvent> pno_scan_event_handler_; 129 ::android::sp<::android::net::wifi::IPnoScanEvent> pno_scan_event_handler_;
130 ::android::sp<::android::net::wifi::IScanEvent> scan_event_handler_; 130 ::android::sp<::android::net::wifi::IScanEvent> scan_event_handler_;
131 std::unique_ptr<OffloadScanManager> offload_scan_manager_; 131 std::shared_ptr<OffloadScanManager> offload_scan_manager_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(ScannerImpl); 133 DISALLOW_COPY_AND_ASSIGN(ScannerImpl);
134}; 134};
diff --git a/tests/mock_offload_scan_callback_interface.h b/tests/mock_offload_scan_callback_interface.h
index e7cdcc1..e4f8df9 100644
--- a/tests/mock_offload_scan_callback_interface.h
+++ b/tests/mock_offload_scan_callback_interface.h
@@ -14,8 +14,8 @@
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
17#ifndef WIFICOND_TESTS_MOCK_OFFLOAD_CALLBACK_HANDLERS_H_ 17#ifndef WIFICOND_TESTS_MOCK_OFFLOAD_SCAN_CALLBACK_INTERFACE_H_
18#define WIFICOND_TESTS_MOCK_OFFLOAD_CALLBACK_HANDLERS_H_ 18#define WIFICOND_TESTS_MOCK_OFFLOAD_SCAN_CALLBACK_INTERFACE_H_
19 19
20#include <gmock/gmock.h> 20#include <gmock/gmock.h>
21#include <gtest/gtest.h> 21#include <gtest/gtest.h>
@@ -38,4 +38,4 @@ class MockOffloadScanCallbackInterface : public OffloadScanCallbackInterface {
38} // namespace wificond 38} // namespace wificond
39} // namespace android 39} // namespace android
40 40
41#endif // WIFICOND_TESTS_MOCK_OFFLOAD_CALLBACK_HANDLERS_H_ 41#endif // WIFICOND_TESTS_MOCK_OFFLOAD_SCAN_CALLBACK_INTERFACE_H_
diff --git a/tests/mock_offload_scan_callback_interface_impl.cpp b/tests/mock_offload_scan_callback_interface_impl.cpp
new file mode 100644
index 0000000..b9dffc5
--- /dev/null
+++ b/tests/mock_offload_scan_callback_interface_impl.cpp
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2017 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#include "wificond/tests/mock_offload_scan_callback_interface_impl.h"
18#include "wificond/scanning/scanner_impl.h"
19
20namespace android {
21namespace wificond {
22
23MockOffloadScanCallbackInterfaceImpl::MockOffloadScanCallbackInterfaceImpl(
24 ScannerImpl* parent)
25 : OffloadScanCallbackInterfaceImpl(parent) {}
26
27} // namespace wificond
28} // namespace android
diff --git a/tests/mock_offload_scan_callback_interface_impl.h b/tests/mock_offload_scan_callback_interface_impl.h
new file mode 100644
index 0000000..8b76388
--- /dev/null
+++ b/tests/mock_offload_scan_callback_interface_impl.h
@@ -0,0 +1,44 @@
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_TESTS_MOCK_OFFLOAD_SCAN_CALLBACK_INTERFACE_IMPL_H__
18#define WIFICOND_TESTS_MOCK_OFFLOAD_SCAN_CALLBACK_INTERFACE_IMPL_H__
19
20#include <gmock/gmock.h>
21#include <gtest/gtest.h>
22
23#include "wificond/scanning/offload_scan_callback_interface_impl.h"
24
25namespace android {
26namespace wificond {
27
28class ScannerImpl;
29
30class MockOffloadScanCallbackInterfaceImpl
31 : public OffloadScanCallbackInterfaceImpl {
32 public:
33 MockOffloadScanCallbackInterfaceImpl(ScannerImpl*);
34 ~MockOffloadScanCallbackInterfaceImpl() override = default;
35
36 MOCK_METHOD0(OnOffloadScanResult, void());
37 MOCK_METHOD1(OnOffloadError,
38 void(OffloadScanCallbackInterface::AsyncErrorReason));
39};
40
41} // namespace wificond
42} // namespace android
43
44#endif // WIFICOND_TESTS_MOCK_OFFLOAD_SCAN_CALLBACK_INTERFACE_IMPL_H__
diff --git a/tests/mock_offload_scan_manager.cpp b/tests/mock_offload_scan_manager.cpp
new file mode 100644
index 0000000..8943524
--- /dev/null
+++ b/tests/mock_offload_scan_manager.cpp
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2017 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#include "wificond/tests/mock_offload_scan_manager.h"
18
19namespace android {
20namespace wificond {
21
22MockOffloadScanManager::MockOffloadScanManager(
23 std::weak_ptr<OffloadServiceUtils> service_utils,
24 std::shared_ptr<OffloadScanCallbackInterface> callback_interface)
25 : OffloadScanManager(service_utils, callback_interface) {}
26
27} // namespace wificond
28} // namespace android
diff --git a/tests/mock_offload_scan_manager.h b/tests/mock_offload_scan_manager.h
new file mode 100644
index 0000000..71d5e79
--- /dev/null
+++ b/tests/mock_offload_scan_manager.h
@@ -0,0 +1,56 @@
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_TESTS_MOCK_OFFLOAD_SCAN_MANAGER_H_
18#define WIFICOND_TESTS_MOCK_OFFLOAD_SCAN_MANAGER_H_
19
20#include <gmock/gmock.h>
21#include <gtest/gtest.h>
22
23#include "wificond/scanning/offload/offload_scan_manager.h"
24
25namespace android {
26namespace wificond {
27
28class MockOffloadScanManager : public OffloadScanManager {
29 public:
30 MockOffloadScanManager(
31 std::weak_ptr<OffloadServiceUtils> service_utils,
32 std::shared_ptr<OffloadScanCallbackInterface> callback_interface);
33 ~MockOffloadScanManager() override = default;
34
35 MOCK_METHOD7(startScan,
36 bool(uint32_t interval_ms, int32_t rssi_threshold,
37 const std::vector<std::vector<uint8_t>>& scan_ssids,
38 const std::vector<std::vector<uint8_t>>& match_ssids,
39 const std::vector<uint8_t>& match_security,
40 const std::vector<uint32_t>& frequencies,
41 OffloadScanManager::ReasonCode* reason_code));
42 MOCK_METHOD1(stopScan, bool(OffloadScanManager::ReasonCode* reason_code));
43 MOCK_METHOD1(getScanStats,
44 bool(::com::android::server::wifi::wificond::NativeScanStats*
45 scan_stats));
46 MOCK_CONST_METHOD0(getOffloadStatus, OffloadScanManager::StatusCode());
47 MOCK_METHOD1(
48 getScanResults,
49 bool(std::vector<
50 ::com::android::server::wifi::wificond::NativeScanResult>*));
51};
52
53} // namespace wificond
54} // namespace android
55
56#endif // WIFICOND_TESTS_MOCK_OFFLOAD_SCAN_MANAGER_H_
diff --git a/tests/mock_offload_service_utils.h b/tests/mock_offload_service_utils.h
index fd9fd34..76d022d 100644
--- a/tests/mock_offload_service_utils.h
+++ b/tests/mock_offload_service_utils.h
@@ -24,6 +24,7 @@
24#include "wificond/scanning/offload/offload_callback.h" 24#include "wificond/scanning/offload/offload_callback.h"
25#include "wificond/scanning/offload/offload_callback_handlers.h" 25#include "wificond/scanning/offload/offload_callback_handlers.h"
26#include "wificond/scanning/offload/offload_service_utils.h" 26#include "wificond/scanning/offload/offload_service_utils.h"
27#include "wificond/scanning/offload_scan_callback_interface_impl.h"
27 28
28namespace android { 29namespace android {
29namespace wificond { 30namespace wificond {
@@ -40,6 +41,14 @@ class MockOffloadServiceUtils : public OffloadServiceUtils {
40 MOCK_METHOD1(GetOffloadDeathRecipient, 41 MOCK_METHOD1(GetOffloadDeathRecipient,
41 android::wificond::OffloadDeathRecipient*( 42 android::wificond::OffloadDeathRecipient*(
42 OffloadDeathRecipientHandler handler)); 43 OffloadDeathRecipientHandler handler));
44 MOCK_METHOD1(
45 GetOffloadScanCallbackInterface,
46 std::shared_ptr<OffloadScanCallbackInterfaceImpl>(ScannerImpl* scanner));
47 MOCK_METHOD2(GetOffloadScanManager,
48 std::shared_ptr<OffloadScanManager>(
49 std::weak_ptr<OffloadServiceUtils> service_utils,
50 std::shared_ptr<OffloadScanCallbackInterfaceImpl>
51 callback_interface));
43}; 52};
44 53
45} // namespace wificond 54} // namespace wificond
diff --git a/tests/scanner_unittest.cpp b/tests/scanner_unittest.cpp
index bbaeffd..1a93e31 100644
--- a/tests/scanner_unittest.cpp
+++ b/tests/scanner_unittest.cpp
@@ -25,6 +25,8 @@
25#include "wificond/tests/mock_client_interface_impl.h" 25#include "wificond/tests/mock_client_interface_impl.h"
26#include "wificond/tests/mock_netlink_manager.h" 26#include "wificond/tests/mock_netlink_manager.h"
27#include "wificond/tests/mock_netlink_utils.h" 27#include "wificond/tests/mock_netlink_utils.h"
28#include "wificond/tests/mock_offload_scan_callback_interface_impl.h"
29#include "wificond/tests/mock_offload_scan_manager.h"
28#include "wificond/tests/mock_offload_service_utils.h" 30#include "wificond/tests/mock_offload_service_utils.h"
29#include "wificond/tests/mock_scan_utils.h" 31#include "wificond/tests/mock_scan_utils.h"
30 32
@@ -91,6 +93,10 @@ class ScannerTest : public ::testing::Test {
91 void SetUp() override { 93 void SetUp() override {
92 ON_CALL(*offload_service_utils_, IsOffloadScanSupported()).WillByDefault( 94 ON_CALL(*offload_service_utils_, IsOffloadScanSupported()).WillByDefault(
93 Return(false)); 95 Return(false));
96 ON_CALL(*offload_service_utils_, GetOffloadScanManager(_, _))
97 .WillByDefault(Return(offload_scan_manager_));
98 ON_CALL(*offload_service_utils_, GetOffloadScanCallbackInterface(_))
99 .WillByDefault(Return(offload_scan_callback_interface_));
94 netlink_scanner_.reset(new ScannerImpl( 100 netlink_scanner_.reset(new ScannerImpl(
95 kFakeWiphyIndex, kFakeInterfaceIndex, 101 kFakeWiphyIndex, kFakeInterfaceIndex,
96 scan_capabilities_, wiphy_features_, 102 scan_capabilities_, wiphy_features_,
@@ -108,6 +114,13 @@ class ScannerTest : public ::testing::Test {
108 &if_tool_, &supplicant_manager_, &netlink_utils_, &scan_utils_}; 114 &if_tool_, &supplicant_manager_, &netlink_utils_, &scan_utils_};
109 shared_ptr<NiceMock<MockOffloadServiceUtils>> offload_service_utils_{ 115 shared_ptr<NiceMock<MockOffloadServiceUtils>> offload_service_utils_{
110 new NiceMock<MockOffloadServiceUtils>()}; 116 new NiceMock<MockOffloadServiceUtils>()};
117 shared_ptr<NiceMock<MockOffloadScanCallbackInterfaceImpl>>
118 offload_scan_callback_interface_{
119 new NiceMock<MockOffloadScanCallbackInterfaceImpl>(
120 netlink_scanner_.get())};
121 std::shared_ptr<NiceMock<MockOffloadScanManager>> offload_scan_manager_{
122 new NiceMock<MockOffloadScanManager>(offload_service_utils_,
123 offload_scan_callback_interface_)};
111 ScanCapabilities scan_capabilities_; 124 ScanCapabilities scan_capabilities_;
112 WiphyFeatures wiphy_features_; 125 WiphyFeatures wiphy_features_;
113}; 126};