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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the previous fix Created 9 years, 7 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.
11 // 11 //
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename); 632 FilePath path = user_data_dir().Append(chrome::kLocalStateFilename);
633 return PrefServiceMockBuilder().WithUserFilePrefs(path).Create(); 633 return PrefServiceMockBuilder().WithUserFilePrefs(path).Create();
634 } 634 }
635 635
636 void GetStabilityMetrics(NavigationMetrics* metrics) { 636 void GetStabilityMetrics(NavigationMetrics* metrics) {
637 if (!metrics) 637 if (!metrics)
638 return; 638 return;
639 scoped_ptr<PrefService> local_state(GetLocalState()); 639 scoped_ptr<PrefService> local_state(GetLocalState());
640 if (!local_state.get()) 640 if (!local_state.get())
641 return; 641 return;
642 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false); 642 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly,
643 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1); 643 false,
644 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1); 644 false /* don't sync pref */);
645 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0); 645 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount,
646 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 646 -1,
647 false /* don't sync pref */);
648 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount,
649 -1,
650 false /* don't sync pref */);
651 local_state->RegisterIntegerPref(prefs::kStabilityCrashCount,
652 0,
653 false /* don't sync pref */);
654 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount,
655 0,
656 false /* don't sync pref */);
647 657
648 metrics->browser_clean_exit = 658 metrics->browser_clean_exit =
649 local_state->GetBoolean(prefs::kStabilityExitedCleanly); 659 local_state->GetBoolean(prefs::kStabilityExitedCleanly);
650 metrics->browser_launch_count = 660 metrics->browser_launch_count =
651 local_state->GetInteger(prefs::kStabilityLaunchCount); 661 local_state->GetInteger(prefs::kStabilityLaunchCount);
652 metrics->page_load_count = 662 metrics->page_load_count =
653 local_state->GetInteger(prefs::kStabilityPageLoadCount); 663 local_state->GetInteger(prefs::kStabilityPageLoadCount);
654 metrics->browser_crash_count = 664 metrics->browser_crash_count =
655 local_state->GetInteger(prefs::kStabilityCrashCount); 665 local_state->GetInteger(prefs::kStabilityCrashCount);
656 metrics->renderer_crash_count = 666 metrics->renderer_crash_count =
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 } 830 }
821 } 831 }
822 832
823 if (parsed_command_line.HasSwitch(kStressOptSwitch)) { 833 if (parsed_command_line.HasSwitch(kStressOptSwitch)) {
824 g_stress_opt = true; 834 g_stress_opt = true;
825 } 835 }
826 if (parsed_command_line.HasSwitch(kStressDeoptSwitch)) { 836 if (parsed_command_line.HasSwitch(kStressDeoptSwitch)) {
827 g_stress_deopt = true; 837 g_stress_deopt = true;
828 } 838 }
829 } 839 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698