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

Unified 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: Fix double registration in Chrome Frame test. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/testing_pref_service.cc ('k') | chrome_frame/test/net/fake_external_tab.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/reliability/page_load_test.cc
diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc
index ce333e8a9b35314561f6f4642a3d9b4910a98dad..6835058a513065510b8b48e58effe26fe0679eea 100644
--- a/chrome/test/reliability/page_load_test.cc
+++ b/chrome/test/reliability/page_load_test.cc
@@ -52,6 +52,7 @@
#include "base/threading/platform_thread.h"
#include "base/time.h"
#include "chrome/browser/net/url_fixer_upper.h"
+#include "chrome/browser/prefs/pref_registry_simple.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/pref_service_mock_builder.h"
#include "chrome/common/automation_messages.h"
@@ -745,25 +746,27 @@ class PageLoadTest : public UITest {
// Get a PrefService whose contents correspond to the Local State file
// that was saved by the app as it closed. The caller takes ownership of the
// returned PrefService object.
- PrefServiceSimple* GetLocalState() {
+ PrefService* GetLocalState(PrefRegistry* registry) {
FilePath path = user_data_dir().Append(chrome::kLocalStateFilename);
PrefServiceMockBuilder builder;
builder.WithUserFilePrefs(path,
MessageLoop::current()->message_loop_proxy());
- return builder.CreateSimple();
+ return builder.Create(registry);
}
void GetStabilityMetrics(NavigationMetrics* metrics) {
if (!metrics)
return;
- scoped_ptr<PrefServiceSimple> local_state(GetLocalState());
+ scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple();
+ registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false);
+ registry->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1);
+ registry->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1);
+ registry->RegisterIntegerPref(prefs::kStabilityCrashCount, 0);
+ registry->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
+
+ scoped_ptr<PrefService> local_state(GetLocalState(registry));
if (!local_state.get())
return;
- local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, false);
- local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, -1);
- local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, -1);
- local_state->RegisterIntegerPref(prefs::kStabilityCrashCount, 0);
- local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
metrics->browser_clean_exit =
local_state->GetBoolean(prefs::kStabilityExitedCleanly);
« no previous file with comments | « chrome/test/base/testing_pref_service.cc ('k') | chrome_frame/test/net/fake_external_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698