Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/test/reliability/page_load_test.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 num_dumps++; 747 num_dumps++;
748 } 748 }
749 } 749 }
750 if (metrics) 750 if (metrics)
751 metrics->crash_dump_count = num_dumps; 751 metrics->crash_dump_count = num_dumps;
752 } 752 }
753 753
754 // Get a PrefService whose contents correspond to the Local State file 754 // Get a PrefService whose contents correspond to the Local State file
755 // that was saved by the app as it closed. The caller takes ownership of the 755 // that was saved by the app as it closed. The caller takes ownership of the
756 // returned PrefService object. 756 // returned PrefService object.
757 PrefServiceSimple* GetLocalState() { 757 PrefService* GetLocalState() {
758 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename); 758 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename);
759 PrefServiceMockBuilder builder; 759 PrefServiceMockBuilder builder;
760 builder.WithUserFilePrefs(path, 760 builder.WithUserFilePrefs(path,
761 MessageLoop::current()->message_loop_proxy()); 761 MessageLoop::current()->message_loop_proxy());
762 return builder.CreateSimple(); 762 return builder.CreateSimple();
763 } 763 }
764 764
765 void GetStabilityMetrics(NavigationMetrics* metrics) { 765 void GetStabilityMetrics(NavigationMetrics* metrics) {
766 if (!metrics) 766 if (!metrics)
767 return; 767 return;
768 scoped_ptr<PrefServiceSimple> local_state(GetLocalState()); 768 scoped_ptr<PrefService> local_state(GetLocalState());
769 if (!local_state.get()) 769 if (!local_state.get())
770 return; 770 return;
771 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); 771 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false);
772 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); 772 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1);
773 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); 773 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1);
774 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); 774 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0);
775 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 775 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
776 776
777 metrics->browser_clean_exit = 777 metrics->browser_clean_exit =
778 local_state->GetBoolean(prefs::kStabilityExitedCleanly); 778 local_state->GetBoolean(prefs::kStabilityExitedCleanly);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 if (!g_end_url.empty()) { 835 if (!g_end_url.empty()) {
836 NavigateToURLLogResult( 836 NavigateToURLLogResult(
837 g_end_url, log_file, NULL, g_continuous_load, false); 837 g_end_url, log_file, NULL, g_continuous_load, false);
838 } 838 }
839 839
840 log_file.close(); 840 log_file.close();
841 } 841 }
842 842
843 } // namespace 843 } // namespace
844 844
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698