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

Side by Side Diff: chrome/browser/metrics/metrics_log_unittest.cc

Issue 4974001: base: Get rid of 'using' declaration of StringAppendF. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/history/text_database.cc ('k') | chrome/browser/net/predictor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 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 <string> 5 #include <string>
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "chrome/browser/metrics/metrics_log.h" 9 #include "chrome/browser/metrics/metrics_log.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 }; 206 };
207 207
208 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) { 208 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); i++) {
209 std::string hash_string = MetricsLog::CreateHash(cases[i].input); 209 std::string hash_string = MetricsLog::CreateHash(cases[i].input);
210 210
211 // Convert to hex string 211 // Convert to hex string
212 // We're only checking the first 8 bytes, because that's what 212 // We're only checking the first 8 bytes, because that's what
213 // the metrics server uses. 213 // the metrics server uses.
214 std::string hash_hex = "0x"; 214 std::string hash_hex = "0x";
215 for (size_t j = 0; j < 8; j++) { 215 for (size_t j = 0; j < 8; j++) {
216 StringAppendF(&hash_hex, "%02x", 216 base::StringAppendF(&hash_hex, "%02x",
217 static_cast<uint8>(hash_string.data()[j])); 217 static_cast<uint8>(hash_string.data()[j]));
218 } 218 }
219 EXPECT_EQ(cases[i].output, hash_hex); 219 EXPECT_EQ(cases[i].output, hash_hex);
220 } 220 }
221 }; 221 };
OLDNEW
« no previous file with comments | « chrome/browser/history/text_database.cc ('k') | chrome/browser/net/predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698