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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/metrics/metrics_log.h" | 10 #include "chrome/browser/metrics/metrics_log.h" |
11 #include "chrome/browser/prefs/browser_prefs.h" | 11 #include "chrome/browser/prefs/browser_prefs.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "chrome/test/testing_pref_service.h" | 14 #include "chrome/test/base/testing_pref_service.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 using base::TimeDelta; | 18 using base::TimeDelta; |
19 | 19 |
20 namespace { | 20 namespace { |
21 class MetricsLogTest : public testing::Test { | 21 class MetricsLogTest : public testing::Test { |
22 }; | 22 }; |
23 }; | 23 }; |
24 | 24 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // We're only checking the first 8 bytes, because that's what | 263 // We're only checking the first 8 bytes, because that's what |
264 // the metrics server uses. | 264 // the metrics server uses. |
265 std::string hash_hex = "0x"; | 265 std::string hash_hex = "0x"; |
266 for (size_t j = 0; j < 8; j++) { | 266 for (size_t j = 0; j < 8; j++) { |
267 base::StringAppendF(&hash_hex, "%02x", | 267 base::StringAppendF(&hash_hex, "%02x", |
268 static_cast<uint8>(hash_string.data()[j])); | 268 static_cast<uint8>(hash_string.data()[j])); |
269 } | 269 } |
270 EXPECT_EQ(cases[i].output, hash_hex); | 270 EXPECT_EQ(cases[i].output, hash_hex); |
271 } | 271 } |
272 }; | 272 }; |
OLD | NEW |