Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc

Issue 12767006: [Cleanup] Remove StringPrintf from global namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, once more Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698