| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 732 } |
| 733 if (metrics) | 733 if (metrics) |
| 734 metrics->crash_dump_count = num_dumps; | 734 metrics->crash_dump_count = num_dumps; |
| 735 } | 735 } |
| 736 | 736 |
| 737 // Get a PrefService whose contents correspond to the Local State file | 737 // Get a PrefService whose contents correspond to the Local State file |
| 738 // that was saved by the app as it closed. The caller takes ownership of the | 738 // that was saved by the app as it closed. The caller takes ownership of the |
| 739 // returned PrefService object. | 739 // returned PrefService object. |
| 740 PrefService* GetLocalState() { | 740 PrefService* GetLocalState() { |
| 741 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename); | 741 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename); |
| 742 return PrefServiceMockBuilder().WithUserFilePrefs(path).Create(); | 742 return PrefServiceMockBuilder().WithUserFilePrefs( |
| 743 path, MessageLoop::current()->message_loop_proxy()).Create(); |
| 743 } | 744 } |
| 744 | 745 |
| 745 void GetStabilityMetrics(NavigationMetrics* metrics) { | 746 void GetStabilityMetrics(NavigationMetrics* metrics) { |
| 746 if (!metrics) | 747 if (!metrics) |
| 747 return; | 748 return; |
| 748 scoped_ptr<PrefService> local_state(GetLocalState()); | 749 scoped_ptr<PrefService> local_state(GetLocalState()); |
| 749 if (!local_state.get()) | 750 if (!local_state.get()) |
| 750 return; | 751 return; |
| 751 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); | 752 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); |
| 752 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); | 753 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 if (!g_end_url.empty()) { | 813 if (!g_end_url.empty()) { |
| 813 NavigateToURLLogResult( | 814 NavigateToURLLogResult( |
| 814 g_end_url, log_file, NULL, g_continuous_load, false); | 815 g_end_url, log_file, NULL, g_continuous_load, false); |
| 815 } | 816 } |
| 816 | 817 |
| 817 log_file.close(); | 818 log_file.close(); |
| 818 } | 819 } |
| 819 | 820 |
| 820 } // namespace | 821 } // namespace |
| 821 | 822 |
| OLD | NEW |