OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chromeos/dbus/dbus_thread_manager.h" | 8 #include "chromeos/dbus/dbus_thread_manager.h" |
9 #include "chromeos/dbus/shill_manager_client.h" | 9 #include "chromeos/dbus/shill_manager_client.h" |
10 #include "chromeos/network/geolocation_handler.h" | 10 #include "chromeos/network/geolocation_handler.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 return provider_->GetAccessPointData(&ap_data_); | 39 return provider_->GetAccessPointData(&ap_data_); |
40 } | 40 } |
41 | 41 |
42 void AddAccessPoints(int ssids, int aps_per_ssid) { | 42 void AddAccessPoints(int ssids, int aps_per_ssid) { |
43 for (int i = 0; i < ssids; ++i) { | 43 for (int i = 0; i < ssids; ++i) { |
44 for (int j = 0; j < aps_per_ssid; ++j) { | 44 for (int j = 0; j < aps_per_ssid; ++j) { |
45 base::DictionaryValue properties; | 45 base::DictionaryValue properties; |
46 std::string mac_address = | 46 std::string mac_address = |
47 base::StringPrintf("%02X:%02X:%02X:%02X:%02X:%02X", | 47 base::StringPrintf("%02X:%02X:%02X:%02X:%02X:%02X", |
48 i, j, 3, 4, 5, 6); | 48 i, j, 3, 4, 5, 6); |
49 std::string channel = StringPrintf("%d", i * 10 + j); | 49 std::string channel = base::StringPrintf("%d", i * 10 + j); |
50 std::string strength = StringPrintf("%d", i * 100 + j); | 50 std::string strength = base::StringPrintf("%d", i * 100 + j); |
51 properties.SetStringWithoutPathExpansion( | 51 properties.SetStringWithoutPathExpansion( |
52 shill::kGeoMacAddressProperty, mac_address); | 52 shill::kGeoMacAddressProperty, mac_address); |
53 properties.SetStringWithoutPathExpansion( | 53 properties.SetStringWithoutPathExpansion( |
54 shill::kGeoChannelProperty, channel); | 54 shill::kGeoChannelProperty, channel); |
55 properties.SetStringWithoutPathExpansion( | 55 properties.SetStringWithoutPathExpansion( |
56 shill::kGeoSignalStrengthProperty, strength); | 56 shill::kGeoSignalStrengthProperty, strength); |
57 manager_test_->AddGeoNetwork(flimflam::kTypeWifi, properties); | 57 manager_test_->AddGeoNetwork(flimflam::kTypeWifi, properties); |
58 } | 58 } |
59 } | 59 } |
60 message_loop_.RunUntilIdle(); | 60 message_loop_.RunUntilIdle(); |
(...skipping 29 matching lines...) Expand all Loading... |
90 TEST_F(GeolocationChromeOsWifiDataProviderTest, GetManyAccessPoints) { | 90 TEST_F(GeolocationChromeOsWifiDataProviderTest, GetManyAccessPoints) { |
91 message_loop_.RunUntilIdle(); | 91 message_loop_.RunUntilIdle(); |
92 EXPECT_FALSE(GetAccessPointData()); | 92 EXPECT_FALSE(GetAccessPointData()); |
93 | 93 |
94 AddAccessPoints(3, 4); | 94 AddAccessPoints(3, 4); |
95 EXPECT_TRUE(GetAccessPointData()); | 95 EXPECT_TRUE(GetAccessPointData()); |
96 ASSERT_EQ(12u, ap_data_.size()); | 96 ASSERT_EQ(12u, ap_data_.size()); |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |