Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/geolocation/wifi_data_provider_linux.h" | 5 #include "device/geolocation/wifi_data_provider_linux.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 GetObjectProxy( | 85 GetObjectProxy( |
| 86 "org.freedesktop.NetworkManager", | 86 "org.freedesktop.NetworkManager", |
| 87 dbus::ObjectPath("/org/freedesktop/NetworkManager/AccessPoint/0"))) | 87 dbus::ObjectPath("/org/freedesktop/NetworkManager/AccessPoint/0"))) |
| 88 .WillOnce(Return(mock_access_point_proxy_.get())); | 88 .WillOnce(Return(mock_access_point_proxy_.get())); |
| 89 | 89 |
| 90 // ShutdownAndBlock() should be called. | 90 // ShutdownAndBlock() should be called. |
| 91 EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); | 91 EXPECT_CALL(*mock_bus_.get(), ShutdownAndBlock()).WillOnce(Return()); |
| 92 | 92 |
| 93 // Create the wlan API with the mock bus object injected. | 93 // Create the wlan API with the mock bus object injected. |
| 94 wifi_provider_linux_ = new WifiDataProviderLinux; | 94 wifi_provider_linux_ = new WifiDataProviderLinux; |
| 95 wlan_api_.reset( | 95 wlan_api_ = wifi_provider_linux_->CreateWlanApiForTesting(mock_bus_.get()); |
| 96 wifi_provider_linux_->NewWlanApiForTesting(mock_bus_.get())); | |
| 97 ASSERT_TRUE(wlan_api_.get()); | 96 ASSERT_TRUE(wlan_api_.get()); |
|
Reilly Grant (use Gerrit)
2017/04/24 19:42:33
ASSERT_TRUE(wlan_api_);
mcasas
2017/04/24 19:47:35
Done.
| |
| 98 } | 97 } |
| 99 | 98 |
| 100 protected: | 99 protected: |
| 101 // WifiDataProvider requires a task runner to be present. The |message_loop_| | 100 // WifiDataProvider requires a task runner to be present. The |message_loop_| |
| 102 // is defined here, as it should outlive |wifi_provider_linux_|. | 101 // is defined here, as it should outlive |wifi_provider_linux_|. |
| 103 base::MessageLoopForUI message_loop_; | 102 base::MessageLoopForUI message_loop_; |
| 104 scoped_refptr<dbus::MockBus> mock_bus_; | 103 scoped_refptr<dbus::MockBus> mock_bus_; |
| 105 scoped_refptr<dbus::MockObjectProxy> mock_network_manager_proxy_; | 104 scoped_refptr<dbus::MockObjectProxy> mock_network_manager_proxy_; |
| 106 scoped_refptr<dbus::MockObjectProxy> mock_access_point_proxy_; | 105 scoped_refptr<dbus::MockObjectProxy> mock_access_point_proxy_; |
| 107 scoped_refptr<dbus::MockObjectProxy> mock_device_proxy_; | 106 scoped_refptr<dbus::MockObjectProxy> mock_device_proxy_; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 // Check the contents of the access point data. | 218 // Check the contents of the access point data. |
| 220 // The expected values come from CreateAccessPointProxyResponse() above. | 219 // The expected values come from CreateAccessPointProxyResponse() above. |
| 221 EXPECT_EQ("test", base::UTF16ToUTF8(access_point_data.ssid)); | 220 EXPECT_EQ("test", base::UTF16ToUTF8(access_point_data.ssid)); |
| 222 EXPECT_EQ("00-11-22-33-44-55", | 221 EXPECT_EQ("00-11-22-33-44-55", |
| 223 base::UTF16ToUTF8(access_point_data.mac_address)); | 222 base::UTF16ToUTF8(access_point_data.mac_address)); |
| 224 EXPECT_EQ(-50, access_point_data.radio_signal_strength); | 223 EXPECT_EQ(-50, access_point_data.radio_signal_strength); |
| 225 EXPECT_EQ(4, access_point_data.channel); | 224 EXPECT_EQ(4, access_point_data.channel); |
| 226 } | 225 } |
| 227 | 226 |
| 228 } // namespace device | 227 } // namespace device |
| OLD | NEW |