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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/port.h" | 9 #include "base/port.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 {37, 43}, | 44 {37, 43}, |
45 {13, 47}, | 45 {13, 47}, |
46 {23, 17} | 46 {23, 17} |
47 }; | 47 }; |
48 | 48 |
49 class TestMetricsLog : public MetricsLog { | 49 class TestMetricsLog : public MetricsLog { |
50 public: | 50 public: |
51 TestMetricsLog(const std::string& client_id, int session_id) | 51 TestMetricsLog(const std::string& client_id, int session_id) |
52 : MetricsLog(client_id, session_id), | 52 : MetricsLog(client_id, session_id), |
53 brand_for_testing_(kBrandForTesting) { | 53 brand_for_testing_(kBrandForTesting) { |
54 chrome::RegisterLocalState(prefs_.registry(), &prefs_); | 54 chrome::RegisterLocalState(&prefs_, prefs_.registry()); |
55 | 55 |
56 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
57 prefs_.SetInteger(prefs::kStabilityChildProcessCrashCount, 10); | 57 prefs_.SetInteger(prefs::kStabilityChildProcessCrashCount, 10); |
58 prefs_.SetInteger(prefs::kStabilityOtherUserCrashCount, 11); | 58 prefs_.SetInteger(prefs::kStabilityOtherUserCrashCount, 11); |
59 prefs_.SetInteger(prefs::kStabilityKernelCrashCount, 12); | 59 prefs_.SetInteger(prefs::kStabilityKernelCrashCount, 12); |
60 prefs_.SetInteger(prefs::kStabilitySystemUncleanShutdownCount, 13); | 60 prefs_.SetInteger(prefs::kStabilitySystemUncleanShutdownCount, 13); |
61 #endif // OS_CHROMEOS | 61 #endif // OS_CHROMEOS |
62 } | 62 } |
63 virtual ~TestMetricsLog() {} | 63 virtual ~TestMetricsLog() {} |
64 | 64 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 EXPECT_NE(std::string::npos, | 321 EXPECT_NE(std::string::npos, |
322 encoded.find(" childprocesscrashcount=\"10\"")); | 322 encoded.find(" childprocesscrashcount=\"10\"")); |
323 EXPECT_EQ(std::string::npos, | 323 EXPECT_EQ(std::string::npos, |
324 encoded.find(" otherusercrashcount=")); | 324 encoded.find(" otherusercrashcount=")); |
325 EXPECT_EQ(std::string::npos, | 325 EXPECT_EQ(std::string::npos, |
326 encoded.find(" kernelcrashcount=")); | 326 encoded.find(" kernelcrashcount=")); |
327 EXPECT_EQ(std::string::npos, | 327 EXPECT_EQ(std::string::npos, |
328 encoded.find(" systemuncleanshutdowns=")); | 328 encoded.find(" systemuncleanshutdowns=")); |
329 } | 329 } |
330 #endif // OS_CHROMEOS | 330 #endif // OS_CHROMEOS |
OLD | NEW |