| 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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 {37, 43}, | 47 {37, 43}, |
| 48 {13, 47}, | 48 {13, 47}, |
| 49 {23, 17} | 49 {23, 17} |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 class TestMetricsLog : public MetricsLog { | 52 class TestMetricsLog : public MetricsLog { |
| 53 public: | 53 public: |
| 54 TestMetricsLog(const std::string& client_id, int session_id) | 54 TestMetricsLog(const std::string& client_id, int session_id) |
| 55 : MetricsLog(client_id, session_id), | 55 : MetricsLog(client_id, session_id), |
| 56 brand_for_testing_(kBrandForTesting) { | 56 brand_for_testing_(kBrandForTesting) { |
| 57 chrome::RegisterLocalState(&prefs_, prefs_.registry()); | 57 chrome::RegisterLocalState(prefs_.registry()); |
| 58 | 58 |
| 59 #if defined(OS_CHROMEOS) | 59 #if defined(OS_CHROMEOS) |
| 60 prefs_.SetInteger(prefs::kStabilityChildProcessCrashCount, 10); | 60 prefs_.SetInteger(prefs::kStabilityChildProcessCrashCount, 10); |
| 61 prefs_.SetInteger(prefs::kStabilityOtherUserCrashCount, 11); | 61 prefs_.SetInteger(prefs::kStabilityOtherUserCrashCount, 11); |
| 62 prefs_.SetInteger(prefs::kStabilityKernelCrashCount, 12); | 62 prefs_.SetInteger(prefs::kStabilityKernelCrashCount, 12); |
| 63 prefs_.SetInteger(prefs::kStabilitySystemUncleanShutdownCount, 13); | 63 prefs_.SetInteger(prefs::kStabilitySystemUncleanShutdownCount, 13); |
| 64 #endif // OS_CHROMEOS | 64 #endif // OS_CHROMEOS |
| 65 } | 65 } |
| 66 virtual ~TestMetricsLog() {} | 66 virtual ~TestMetricsLog() {} |
| 67 | 67 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 EXPECT_NE(std::string::npos, | 332 EXPECT_NE(std::string::npos, |
| 333 encoded.find(" childprocesscrashcount=\"10\"")); | 333 encoded.find(" childprocesscrashcount=\"10\"")); |
| 334 EXPECT_EQ(std::string::npos, | 334 EXPECT_EQ(std::string::npos, |
| 335 encoded.find(" otherusercrashcount=")); | 335 encoded.find(" otherusercrashcount=")); |
| 336 EXPECT_EQ(std::string::npos, | 336 EXPECT_EQ(std::string::npos, |
| 337 encoded.find(" kernelcrashcount=")); | 337 encoded.find(" kernelcrashcount=")); |
| 338 EXPECT_EQ(std::string::npos, | 338 EXPECT_EQ(std::string::npos, |
| 339 encoded.find(" systemuncleanshutdowns=")); | 339 encoded.find(" systemuncleanshutdowns=")); |
| 340 } | 340 } |
| 341 #endif // OS_CHROMEOS | 341 #endif // OS_CHROMEOS |
| OLD | NEW |