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 "content/browser/geolocation/wifi_data_provider_linux.h" | 5 #include "content/browser/geolocation/wifi_data_provider_linux.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 wifi_provider_linux_ = new WifiDataProviderLinux; | 97 wifi_provider_linux_ = new WifiDataProviderLinux; |
98 wlan_api_.reset( | 98 wlan_api_.reset( |
99 wifi_provider_linux_->NewWlanApiForTesting(mock_bus_.get())); | 99 wifi_provider_linux_->NewWlanApiForTesting(mock_bus_.get())); |
100 ASSERT_TRUE(wlan_api_.get()); | 100 ASSERT_TRUE(wlan_api_.get()); |
101 } | 101 } |
102 | 102 |
103 protected: | 103 protected: |
104 // DeviceDataProviderImplBase, a super class of WifiDataProviderLinux, | 104 // DeviceDataProviderImplBase, a super class of WifiDataProviderLinux, |
105 // requires a message loop to be present. message_loop_ is defined here, | 105 // requires a message loop to be present. message_loop_ is defined here, |
106 // as it should outlive wifi_provider_linux_. | 106 // as it should outlive wifi_provider_linux_. |
107 MessageLoop message_loop_; | 107 base::MessageLoop message_loop_; |
108 scoped_refptr<dbus::MockBus> mock_bus_; | 108 scoped_refptr<dbus::MockBus> mock_bus_; |
109 scoped_refptr<dbus::MockObjectProxy> mock_network_manager_proxy_; | 109 scoped_refptr<dbus::MockObjectProxy> mock_network_manager_proxy_; |
110 scoped_refptr<dbus::MockObjectProxy> mock_access_point_proxy_; | 110 scoped_refptr<dbus::MockObjectProxy> mock_access_point_proxy_; |
111 scoped_refptr<dbus::MockObjectProxy> mock_device_proxy_; | 111 scoped_refptr<dbus::MockObjectProxy> mock_device_proxy_; |
112 scoped_refptr<WifiDataProviderLinux> wifi_provider_linux_; | 112 scoped_refptr<WifiDataProviderLinux> wifi_provider_linux_; |
113 scoped_ptr<WifiDataProviderCommon::WlanApiInterface> wlan_api_; | 113 scoped_ptr<WifiDataProviderCommon::WlanApiInterface> wlan_api_; |
114 | 114 |
115 private: | 115 private: |
116 // Creates a response for |mock_network_manager_proxy_|. | 116 // Creates a response for |mock_network_manager_proxy_|. |
117 dbus::Response* CreateNetworkManagerProxyResponse( | 117 dbus::Response* CreateNetworkManagerProxyResponse( |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 // Check the contents of the access point data. | 222 // Check the contents of the access point data. |
223 // The expected values come from CreateAccessPointProxyResponse() above. | 223 // The expected values come from CreateAccessPointProxyResponse() above. |
224 EXPECT_EQ("test", UTF16ToUTF8(access_point_data.ssid)); | 224 EXPECT_EQ("test", UTF16ToUTF8(access_point_data.ssid)); |
225 EXPECT_EQ("00-11-22-33-44-55", UTF16ToUTF8(access_point_data.mac_address)); | 225 EXPECT_EQ("00-11-22-33-44-55", UTF16ToUTF8(access_point_data.mac_address)); |
226 EXPECT_EQ(-50, access_point_data.radio_signal_strength); | 226 EXPECT_EQ(-50, access_point_data.radio_signal_strength); |
227 EXPECT_EQ(4, access_point_data.channel); | 227 EXPECT_EQ(4, access_point_data.channel); |
228 } | 228 } |
229 | 229 |
230 } // namespace content | 230 } // namespace content |
OLD | NEW |