| 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 // This file provides reliablity test which runs under UI test framework. The | 5 // This file provides reliablity test which runs under UI test framework. The |
| 6 // test is intended to run within QEMU environment. | 6 // test is intended to run within QEMU environment. |
| 7 // | 7 // |
| 8 // Usage 1: reliability_test | 8 // Usage 1: reliability_test |
| 9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly | 9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly |
| 10 // used by buildbot, to verify reliability_test itself runs ok. | 10 // used by buildbot, to verify reliability_test itself runs ok. |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 num_dumps++; | 738 num_dumps++; |
| 739 } | 739 } |
| 740 } | 740 } |
| 741 if (metrics) | 741 if (metrics) |
| 742 metrics->crash_dump_count = num_dumps; | 742 metrics->crash_dump_count = num_dumps; |
| 743 } | 743 } |
| 744 | 744 |
| 745 // Get a PrefService whose contents correspond to the Local State file | 745 // Get a PrefService whose contents correspond to the Local State file |
| 746 // that was saved by the app as it closed. The caller takes ownership of the | 746 // that was saved by the app as it closed. The caller takes ownership of the |
| 747 // returned PrefService object. | 747 // returned PrefService object. |
| 748 PrefServiceSimple* GetLocalState() { | 748 PrefService* GetLocalState() { |
| 749 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename); | 749 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename); |
| 750 PrefServiceMockBuilder builder; | 750 PrefServiceMockBuilder builder; |
| 751 builder.WithUserFilePrefs(path, | 751 builder.WithUserFilePrefs(path, |
| 752 MessageLoop::current()->message_loop_proxy()); | 752 MessageLoop::current()->message_loop_proxy()); |
| 753 return builder.CreateSimple(); | 753 return builder.CreateSimple(); |
| 754 } | 754 } |
| 755 | 755 |
| 756 void GetStabilityMetrics(NavigationMetrics* metrics) { | 756 void GetStabilityMetrics(NavigationMetrics* metrics) { |
| 757 if (!metrics) | 757 if (!metrics) |
| 758 return; | 758 return; |
| 759 scoped_ptr<PrefServiceSimple> local_state(GetLocalState()); | 759 scoped_ptr<PrefService> local_state(GetLocalState()); |
| 760 if (!local_state.get()) | 760 if (!local_state.get()) |
| 761 return; | 761 return; |
| 762 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); | 762 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); |
| 763 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); | 763 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); |
| 764 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); | 764 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); |
| 765 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); | 765 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); |
| 766 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 766 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
| 767 | 767 |
| 768 metrics->browser_clean_exit = | 768 metrics->browser_clean_exit = |
| 769 local_state->GetBoolean(prefs::kStabilityExitedCleanly); | 769 local_state->GetBoolean(prefs::kStabilityExitedCleanly); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 if (!g_end_url.empty()) { | 826 if (!g_end_url.empty()) { |
| 827 NavigateToURLLogResult( | 827 NavigateToURLLogResult( |
| 828 g_end_url, log_file, NULL, g_continuous_load, false); | 828 g_end_url, log_file, NULL, g_continuous_load, false); |
| 829 } | 829 } |
| 830 | 830 |
| 831 log_file.close(); | 831 log_file.close(); |
| 832 } | 832 } |
| 833 | 833 |
| 834 } // namespace | 834 } // namespace |
| 835 | 835 |
| OLD | NEW |