blob: 95a23b86a73c0dc47ffdac603299740f35e816d2 [file] [log] [blame]
Jason Glasgowef965562012-04-10 16:12:35 -04001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "shill/cellular_capability_universal.h"
6
Nathan Williams4b7c2a82012-04-13 15:19:47 -04007#include <string>
8#include <vector>
9
Jason Glasgowef965562012-04-10 16:12:35 -040010#include <base/bind.h>
11#include <chromeos/dbus/service_constants.h>
12#include <gtest/gtest.h>
13#include <mobile_provider.h>
Jason Glasgowaf583282012-04-18 15:18:22 -040014#include <mm/ModemManager-names.h>
Jason Glasgowef965562012-04-10 16:12:35 -040015
16#include "shill/cellular.h"
17#include "shill/cellular_service.h"
Jason Glasgowaf583282012-04-18 15:18:22 -040018#include "shill/dbus_adaptor.h"
Jason Glasgowef965562012-04-10 16:12:35 -040019#include "shill/error.h"
20#include "shill/event_dispatcher.h"
21#include "shill/mock_adaptors.h"
Jason Glasgowaf583282012-04-18 15:18:22 -040022#include "shill/mock_dbus_properties_proxy.h"
Jason Glasgowef965562012-04-10 16:12:35 -040023#include "shill/mock_glib.h"
24#include "shill/mock_manager.h"
25#include "shill/mock_metrics.h"
26#include "shill/mock_mm1_modem_modem3gpp_proxy.h"
27#include "shill/mock_mm1_modem_modemcdma_proxy.h"
28#include "shill/mock_mm1_modem_proxy.h"
29#include "shill/mock_mm1_modem_simple_proxy.h"
30#include "shill/mock_mm1_sim_proxy.h"
31#include "shill/mock_profile.h"
32#include "shill/mock_rtnl_handler.h"
33#include "shill/nice_mock_control.h"
34#include "shill/proxy_factory.h"
35
36using base::Bind;
37using base::Unretained;
38using std::string;
Nathan Williams4b7c2a82012-04-13 15:19:47 -040039using std::vector;
Jason Glasgowef965562012-04-10 16:12:35 -040040using testing::InSequence;
41using testing::NiceMock;
42using testing::Return;
Jason Glasgowcd0349c2012-05-03 23:32:15 -040043using testing::SaveArg;
Jason Glasgowef965562012-04-10 16:12:35 -040044using testing::_;
45
46namespace shill {
47
48MATCHER(IsSuccess, "") {
49 return arg.IsSuccess();
50}
51MATCHER(IsFailure, "") {
52 return arg.IsFailure();
53}
54
55class CellularCapabilityUniversalTest : public testing::Test {
56 public:
57 CellularCapabilityUniversalTest()
58 : manager_(&control_, &dispatcher_, &metrics_, &glib_),
59 cellular_(new Cellular(&control_,
60 &dispatcher_,
61 NULL,
62 &manager_,
63 "",
64 "",
65 0,
66 Cellular::kTypeUniversal,
67 "",
68 "",
69 NULL)),
70 modem_3gpp_proxy_(new mm1::MockModemModem3gppProxy()),
71 modem_cdma_proxy_(new mm1::MockModemModemCdmaProxy()),
72 modem_proxy_(new mm1::MockModemProxy()),
73 modem_simple_proxy_(new mm1::MockModemSimpleProxy()),
74 sim_proxy_(new mm1::MockSimProxy()),
Jason Glasgowaf583282012-04-18 15:18:22 -040075 properties_proxy_(new MockDBusPropertiesProxy()),
Jason Glasgowef965562012-04-10 16:12:35 -040076 proxy_factory_(this),
77 capability_(NULL),
78 device_adaptor_(NULL) {}
79
80 virtual ~CellularCapabilityUniversalTest() {
81 cellular_->service_ = NULL;
82 capability_ = NULL;
83 device_adaptor_ = NULL;
84 }
85
86 virtual void SetUp() {
87 capability_ = dynamic_cast<CellularCapabilityUniversal *>(
88 cellular_->capability_.get());
89 capability_->proxy_factory_ = &proxy_factory_;
90 device_adaptor_ =
91 dynamic_cast<NiceMock<DeviceMockAdaptor> *>(cellular_->adaptor());
92 }
93
94 virtual void TearDown() {
95 capability_->proxy_factory_ = NULL;
96 }
97
Jason Glasgow4380f0d2012-05-03 18:05:04 -040098 void InitProviderDB() {
99 const char kTestMobileProviderDBPath[] = "provider_db_unittest.bfd";
100
101 provider_db_ = mobile_provider_open_db(kTestMobileProviderDBPath);
102 ASSERT_TRUE(provider_db_);
103 cellular_->provider_db_ = provider_db_;
104 }
105
Jason Glasgowef965562012-04-10 16:12:35 -0400106 void InvokeEnable(bool enable, Error *error,
107 const ResultCallback &callback, int timeout) {
108 callback.Run(Error());
109 }
110 void InvokeEnableFail(bool enable, Error *error,
111 const ResultCallback &callback, int timeout) {
112 callback.Run(Error(Error::kOperationFailed));
113 }
Jason Glasgowaf583282012-04-18 15:18:22 -0400114 void InvokeRegister(const string &operator_id, Error *error,
115 const ResultCallback &callback, int timeout) {
116 callback.Run(Error());
117 }
118
Gary Morainceba6aa2012-05-03 10:28:26 -0700119 void InvokeScan(Error *error, const DBusPropertyMapsCallback &callback,
120 int timeout) {
121 callback.Run(CellularCapabilityUniversal::ScanResults(), Error());
122 }
Jason Glasgowcd0349c2012-05-03 23:32:15 -0400123 void ScanError(Error *error, const DBusPropertyMapsCallback &callback,
124 int timeout) {
125 error->Populate(Error::kOperationFailed);
126 }
Gary Morainceba6aa2012-05-03 10:28:26 -0700127
128 void Set3gppProxy() {
129 capability_->modem_3gpp_proxy_.reset(modem_3gpp_proxy_.release());
130 }
131
Jason Glasgowef965562012-04-10 16:12:35 -0400132 MOCK_METHOD1(TestCallback, void(const Error &error));
133
134 protected:
135 static const char kImei[];
Jason Glasgowaf583282012-04-18 15:18:22 -0400136 static const char kSimPath[];
137 static const uint32 kAccessTechnologies;
Jason Glasgowef965562012-04-10 16:12:35 -0400138
139 class TestProxyFactory : public ProxyFactory {
140 public:
141 explicit TestProxyFactory(CellularCapabilityUniversalTest *test) :
142 test_(test) {}
143
144 virtual mm1::ModemModem3gppProxyInterface *CreateMM1ModemModem3gppProxy(
145 const std::string &/* path */,
146 const std::string &/* service */) {
147 return test_->modem_3gpp_proxy_.release();
148 }
149
150 virtual mm1::ModemModemCdmaProxyInterface *CreateMM1ModemModemCdmaProxy(
151 const std::string &/* path */,
152 const std::string &/* service */) {
153 return test_->modem_cdma_proxy_.release();
154 }
155
156 virtual mm1::ModemProxyInterface *CreateMM1ModemProxy(
157 const std::string &/* path */,
158 const std::string &/* service */) {
159 return test_->modem_proxy_.release();
160 }
161
162 virtual mm1::ModemSimpleProxyInterface *CreateMM1ModemSimpleProxy(
163 const std::string &/* path */,
164 const std::string &/* service */) {
165 return test_->modem_simple_proxy_.release();
166 }
167
168 virtual mm1::SimProxyInterface *CreateSimProxy(
169 const std::string &/* path */,
170 const std::string &/* service */) {
171 return test_->sim_proxy_.release();
172 }
Jason Glasgowaf583282012-04-18 15:18:22 -0400173 virtual DBusPropertiesProxyInterface *CreateDBusPropertiesProxy(
174 const std::string &/* path */,
175 const std::string &/* service */) {
176 return test_->properties_proxy_.release();
177 }
Jason Glasgowef965562012-04-10 16:12:35 -0400178
179 private:
180 CellularCapabilityUniversalTest *test_;
181 };
182
183 NiceMockControl control_;
184 EventDispatcher dispatcher_;
185 MockMetrics metrics_;
186 MockGLib glib_;
187 MockManager manager_;
188 CellularRefPtr cellular_;
189 scoped_ptr<mm1::MockModemModem3gppProxy> modem_3gpp_proxy_;
190 scoped_ptr<mm1::MockModemModemCdmaProxy> modem_cdma_proxy_;
191 scoped_ptr<mm1::MockModemProxy> modem_proxy_;
192 scoped_ptr<mm1::MockModemSimpleProxy> modem_simple_proxy_;
193 scoped_ptr<mm1::MockSimProxy> sim_proxy_;
Jason Glasgowaf583282012-04-18 15:18:22 -0400194 scoped_ptr<MockDBusPropertiesProxy> properties_proxy_;
Jason Glasgowef965562012-04-10 16:12:35 -0400195 TestProxyFactory proxy_factory_;
196 CellularCapabilityUniversal *capability_; // Owned by |cellular_|.
197 NiceMock<DeviceMockAdaptor> *device_adaptor_; // Owned by |cellular_|.
Jason Glasgow4380f0d2012-05-03 18:05:04 -0400198 mobile_provider_db *provider_db_;
Jason Glasgowcd0349c2012-05-03 23:32:15 -0400199 DBusPropertyMapsCallback scan_callback_; // saved for testing scan operations
Jason Glasgowef965562012-04-10 16:12:35 -0400200};
201
202const char CellularCapabilityUniversalTest::kImei[] = "999911110000";
Jason Glasgowaf583282012-04-18 15:18:22 -0400203const char CellularCapabilityUniversalTest::kSimPath[] = "/foo/sim";
204const uint32 CellularCapabilityUniversalTest::kAccessTechnologies =
205 MM_MODEM_ACCESS_TECHNOLOGY_LTE |
206 MM_MODEM_ACCESS_TECHNOLOGY_HSPA_PLUS;
Jason Glasgowef965562012-04-10 16:12:35 -0400207
208TEST_F(CellularCapabilityUniversalTest, StartModem) {
Jason Glasgowaf583282012-04-18 15:18:22 -0400209 // Set up mock modem properties
210 DBusPropertiesMap modem_properties;
211 string operator_name = "TestOperator";
212 string operator_code = "001400";
213
214 modem_properties[MM_MODEM_PROPERTY_ACCESSTECHNOLOGIES].
215 writer().append_uint32(kAccessTechnologies);
216
217 ::DBus::Variant v;
218 ::DBus::MessageIter writer = v.writer();
Jason Glasgowef965562012-04-10 16:12:35 -0400219 ::DBus::Struct< uint32_t, bool > quality;
220 quality._1 = 90;
221 quality._2 = true;
Jason Glasgowaf583282012-04-18 15:18:22 -0400222 writer << quality;
223 modem_properties[MM_MODEM_PROPERTY_SIGNALQUALITY] = v;
224
225 // Set up mock modem 3gpp properties
226 DBusPropertiesMap modem3gpp_properties;
227 modem3gpp_properties[MM_MODEM_MODEM3GPP_PROPERTY_ENABLEDFACILITYLOCKS].
228 writer().append_uint32(0);
229 modem3gpp_properties[MM_MODEM_MODEM3GPP_PROPERTY_IMEI].
230 writer().append_string(kImei);
231
232 EXPECT_CALL(*modem_proxy_,
233 Enable(true, _, _, CellularCapability::kTimeoutEnable))
234 .WillOnce(Invoke(this, &CellularCapabilityUniversalTest::InvokeEnable));
235 EXPECT_CALL(*properties_proxy_,
236 GetAll(MM_DBUS_INTERFACE_MODEM))
237 .WillOnce(Return(modem_properties));
238 EXPECT_CALL(*properties_proxy_,
239 GetAll(MM_DBUS_INTERFACE_MODEM_MODEM3GPP))
240 .WillOnce(Return(modem3gpp_properties));
Jason Glasgowef965562012-04-10 16:12:35 -0400241
242 // After setup we lose pointers to the proxies, so it is hard to set
243 // expectations.
244 SetUp();
245
246 Error error;
Jason Glasgowaf583282012-04-18 15:18:22 -0400247 EXPECT_CALL(*this, TestCallback(IsSuccess()));
Jason Glasgowef965562012-04-10 16:12:35 -0400248 ResultCallback callback =
249 Bind(&CellularCapabilityUniversalTest::TestCallback, Unretained(this));
250 capability_->StartModem(&error, callback);
251 EXPECT_TRUE(error.IsSuccess());
Jason Glasgowaf583282012-04-18 15:18:22 -0400252 EXPECT_EQ(kImei, capability_->imei_);
253 EXPECT_EQ(kAccessTechnologies, capability_->access_technologies_);
Jason Glasgowef965562012-04-10 16:12:35 -0400254}
255
256TEST_F(CellularCapabilityUniversalTest, StartModemFail) {
257 EXPECT_CALL(*modem_proxy_,
258 Enable(true, _, _, CellularCapability::kTimeoutEnable))
259 .WillOnce(
260 Invoke(this, &CellularCapabilityUniversalTest::InvokeEnableFail));
261 EXPECT_CALL(*this, TestCallback(IsFailure()));
262 ResultCallback callback =
263 Bind(&CellularCapabilityUniversalTest::TestCallback, Unretained(this));
264 SetUp();
265
266 Error error;
267 capability_->StartModem(&error, callback);
268 EXPECT_TRUE(error.IsSuccess());
269}
270
Jason Glasgowaf583282012-04-18 15:18:22 -0400271TEST_F(CellularCapabilityUniversalTest, PropertiesChanged) {
272 // Set up mock modem properties
273 DBusPropertiesMap modem_properties;
274 modem_properties[MM_MODEM_PROPERTY_ACCESSTECHNOLOGIES].
275 writer().append_uint32(kAccessTechnologies);
276 modem_properties[MM_MODEM_PROPERTY_SIM].
277 writer().append_path(kSimPath);
278
279 // Set up mock modem 3gpp properties
280 DBusPropertiesMap modem3gpp_properties;
281 modem3gpp_properties[MM_MODEM_MODEM3GPP_PROPERTY_ENABLEDFACILITYLOCKS].
282 writer().append_uint32(0);
283 modem3gpp_properties[MM_MODEM_MODEM3GPP_PROPERTY_IMEI].
284 writer().append_string(kImei);
285
286 // Set up mock modem sim properties
287 DBusPropertiesMap sim_properties;
288
289 // After setup we lose pointers to the proxies, so it is hard to set
290 // expectations.
291 EXPECT_CALL(*properties_proxy_,
292 GetAll(MM_DBUS_INTERFACE_SIM))
293 .WillOnce(Return(sim_properties));
294
295 SetUp();
296
297 EXPECT_EQ("", capability_->imei_);
298 EXPECT_EQ(MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN,
299 capability_->access_technologies_);
300 EXPECT_FALSE(capability_->sim_proxy_.get());
301 capability_->OnDBusPropertiesChanged(MM_DBUS_INTERFACE_MODEM,
302 modem_properties, vector<string>());
303 EXPECT_EQ(kAccessTechnologies, capability_->access_technologies_);
304 EXPECT_EQ(kSimPath, capability_->sim_path_);
305 EXPECT_TRUE(capability_->sim_proxy_.get());
306
307 // Changing properties on wrong interface will not have an effect
308 capability_->OnDBusPropertiesChanged(MM_DBUS_INTERFACE_MODEM,
309 modem3gpp_properties,
310 vector<string>());
311 EXPECT_EQ("", capability_->imei_);
312
313 // Changing properties on the right interface gets reflected in the
314 // capabilities object
315 capability_->OnDBusPropertiesChanged(MM_DBUS_INTERFACE_MODEM_MODEM3GPP,
316 modem3gpp_properties,
317 vector<string>());
318 EXPECT_EQ(kImei, capability_->imei_);
319}
320
321TEST_F(CellularCapabilityUniversalTest, SimPropertiesChanged) {
322 // Set up mock modem properties
323 DBusPropertiesMap modem_properties;
324 modem_properties[MM_MODEM_PROPERTY_SIM].writer().append_path(kSimPath);
325
326 // Set up mock modem sim properties
327 const char kImsi[] = "310100000001";
328 DBusPropertiesMap sim_properties;
329 sim_properties[MM_SIM_PROPERTY_IMSI].writer().append_string(kImsi);
330
331 EXPECT_CALL(*properties_proxy_, GetAll(MM_DBUS_INTERFACE_SIM))
332 .WillOnce(Return(sim_properties));
333
334 // After setup we lose pointers to the proxies, so it is hard to set
335 // expectations.
336 SetUp();
Jason Glasgow4380f0d2012-05-03 18:05:04 -0400337 InitProviderDB();
Jason Glasgowaf583282012-04-18 15:18:22 -0400338
Jason Glasgow4380f0d2012-05-03 18:05:04 -0400339 EXPECT_TRUE(cellular_->home_provider().GetName().empty());
340 EXPECT_TRUE(cellular_->home_provider().GetCountry().empty());
341 EXPECT_TRUE(cellular_->home_provider().GetCode().empty());
Jason Glasgowaf583282012-04-18 15:18:22 -0400342 EXPECT_FALSE(capability_->sim_proxy_.get());
343 capability_->OnDBusPropertiesChanged(MM_DBUS_INTERFACE_MODEM,
344 modem_properties, vector<string>());
345 EXPECT_EQ(kSimPath, capability_->sim_path_);
346 EXPECT_TRUE(capability_->sim_proxy_.get());
347 EXPECT_EQ(kImsi, capability_->imsi_);
348
349 // Updating the SIM
350 DBusPropertiesMap new_properties;
Jason Glasgow4380f0d2012-05-03 18:05:04 -0400351 const char kCountry[] = "us";
352 const char kCode[] = "310160";
353 const char kNewImsi[] = "310240123456789";
Jason Glasgowaf583282012-04-18 15:18:22 -0400354 const char kSimIdentifier[] = "9999888";
Jason Glasgow4380f0d2012-05-03 18:05:04 -0400355 const char kOperatorIdentifier[] = "310240";
356 const char kOperatorName[] = "Custom SPN";
Jason Glasgowaf583282012-04-18 15:18:22 -0400357 new_properties[MM_SIM_PROPERTY_IMSI].writer().append_string(kNewImsi);
358 new_properties[MM_SIM_PROPERTY_SIMIDENTIFIER].writer().
359 append_string(kSimIdentifier);
360 new_properties[MM_SIM_PROPERTY_OPERATORIDENTIFIER].writer().
361 append_string(kOperatorIdentifier);
Jason Glasgowaf583282012-04-18 15:18:22 -0400362 capability_->OnDBusPropertiesChanged(MM_DBUS_INTERFACE_SIM,
363 new_properties,
364 vector<string>());
365 EXPECT_EQ(kNewImsi, capability_->imsi_);
366 EXPECT_EQ(kSimIdentifier, capability_->sim_identifier_);
367 EXPECT_EQ(kOperatorIdentifier, capability_->operator_id_);
Jason Glasgow4380f0d2012-05-03 18:05:04 -0400368 EXPECT_EQ("", capability_->spn_);
369 EXPECT_EQ("T-Mobile", cellular_->home_provider().GetName());
370 EXPECT_EQ(kCountry, cellular_->home_provider().GetCountry());
371 EXPECT_EQ(kCode, cellular_->home_provider().GetCode());
372 EXPECT_EQ(4, capability_->apn_list_.size());
373
374 new_properties[MM_SIM_PROPERTY_OPERATORNAME].writer().
375 append_string(kOperatorName);
376 capability_->OnDBusPropertiesChanged(MM_DBUS_INTERFACE_SIM,
377 new_properties,
378 vector<string>());
379 EXPECT_EQ(kOperatorName, cellular_->home_provider().GetName());
Jason Glasgowaf583282012-04-18 15:18:22 -0400380 EXPECT_EQ(kOperatorName, capability_->spn_);
381}
382
Gary Morainceba6aa2012-05-03 10:28:26 -0700383MATCHER_P(SizeIs, value, "") {
384 return static_cast<size_t>(value) == arg.size();
385}
386
387// Validates that OnScanReply does not crash with a null callback.
388TEST_F(CellularCapabilityUniversalTest, ScanWithNullCallback) {
389 Error error;
390 EXPECT_CALL(*modem_3gpp_proxy_, Scan(_, _, CellularCapability::kTimeoutScan))
391 .WillOnce(Invoke(this, &CellularCapabilityUniversalTest::InvokeScan));
392 EXPECT_CALL(*device_adaptor_,
393 EmitStringmapsChanged(flimflam::kFoundNetworksProperty,
394 SizeIs(0)));
395 Set3gppProxy();
396 capability_->Scan(&error, ResultCallback());
397 EXPECT_TRUE(error.IsSuccess());
398}
399
Jason Glasgowcd0349c2012-05-03 23:32:15 -0400400// Validates that the scanning property is updated
401TEST_F(CellularCapabilityUniversalTest, Scan) {
402 Error error;
403
404 EXPECT_CALL(*modem_3gpp_proxy_, Scan(_, _, CellularCapability::kTimeoutScan))
405 .WillRepeatedly(SaveArg<1>(&scan_callback_));
406 EXPECT_CALL(*device_adaptor_,
407 EmitBoolChanged(flimflam::kScanningProperty, true));
408 Set3gppProxy();
409 capability_->Scan(&error, ResultCallback());
410 EXPECT_TRUE(capability_->scanning_);
411
412 // Simulate the completion of the scan with 2 networks in the results.
413 EXPECT_CALL(*device_adaptor_,
414 EmitBoolChanged(flimflam::kScanningProperty, false));
415 EXPECT_CALL(*device_adaptor_,
416 EmitStringmapsChanged(flimflam::kFoundNetworksProperty,
417 SizeIs(2)));
418 vector<DBusPropertiesMap> results;
419 const char kScanID0[] = "testID0";
420 const char kScanID1[] = "testID1";
421 results.push_back(DBusPropertiesMap());
422 results[0][CellularCapabilityUniversal::kOperatorLongProperty].
423 writer().append_string(kScanID0);
424 results.push_back(DBusPropertiesMap());
425 results[1][CellularCapabilityUniversal::kOperatorLongProperty].
426 writer().append_string(kScanID1);
427 scan_callback_.Run(results, error);
428 EXPECT_FALSE(capability_->scanning_);
429
430 // Simulate the completion of the scan with no networks in the results.
431 EXPECT_CALL(*device_adaptor_,
432 EmitBoolChanged(flimflam::kScanningProperty, true));
433 capability_->Scan(&error, ResultCallback());
434 EXPECT_TRUE(capability_->scanning_);
435 EXPECT_CALL(*device_adaptor_,
436 EmitBoolChanged(flimflam::kScanningProperty, false));
437 EXPECT_CALL(*device_adaptor_,
438 EmitStringmapsChanged(flimflam::kFoundNetworksProperty,
439 SizeIs(0)));
440 scan_callback_.Run(vector<DBusPropertiesMap>(), Error());
441 EXPECT_FALSE(capability_->scanning_);
442}
443
444// Validates expected property updates when scan fails
445TEST_F(CellularCapabilityUniversalTest, ScanFailure) {
446 Error error;
447
448 // Test immediate error
449 {
450 InSequence seq;
451 EXPECT_CALL(*modem_3gpp_proxy_,
452 Scan(_, _, CellularCapability::kTimeoutScan))
453 .WillOnce(Invoke(this, &CellularCapabilityUniversalTest::ScanError));
454 EXPECT_CALL(*modem_3gpp_proxy_,
455 Scan(_, _, CellularCapability::kTimeoutScan))
456 .WillOnce(SaveArg<1>(&scan_callback_));
457 }
458 Set3gppProxy();
459 capability_->Scan(&error, ResultCallback());
460 EXPECT_FALSE(capability_->scanning_);
461 EXPECT_TRUE(error.IsFailure());
462
463 // Initiate a scan
464 error.Populate(Error::kSuccess);
465 EXPECT_CALL(*device_adaptor_,
466 EmitBoolChanged(flimflam::kScanningProperty, true));
467 capability_->Scan(&error, ResultCallback());
468 EXPECT_TRUE(capability_->scanning_);
469 EXPECT_TRUE(error.IsSuccess());
470
471 // Validate that error is returned if Scan is called while already scanning.
472 capability_->Scan(&error, ResultCallback());
473 EXPECT_TRUE(capability_->scanning_);
474 EXPECT_TRUE(error.IsFailure());
475
476 // Validate that signals are emitted even if an error is reported.
477 capability_->found_networks_.clear();
478 capability_->found_networks_.push_back(Stringmap());
479 EXPECT_CALL(*device_adaptor_,
480 EmitBoolChanged(flimflam::kScanningProperty, false));
481 EXPECT_CALL(*device_adaptor_,
482 EmitStringmapsChanged(flimflam::kFoundNetworksProperty,
483 SizeIs(0)));
484 vector<DBusPropertiesMap> results;
485 scan_callback_.Run(results, Error(Error::kOperationFailed));
486 EXPECT_FALSE(capability_->scanning_);
487}
488
Jason Glasgowef965562012-04-10 16:12:35 -0400489} // namespace shill