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

Unified Diff: chrome_frame/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_frame/test/net/fake_external_tab.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/reliability/page_load_test.cc
diff --git a/chrome_frame/test/reliability/page_load_test.cc b/chrome_frame/test/reliability/page_load_test.cc
index 1a6b7815b603eb32ec163c56f9ec06c7b6c2507d..3b85697daca7913e73a09845b4df6a7d29ee478a 100644
--- a/chrome_frame/test/reliability/page_load_test.cc
+++ b/chrome_frame/test/reliability/page_load_test.cc
@@ -35,6 +35,7 @@
#include "base/time.h"
#include "base/utf_string_conversions.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/browser/prefs/pref_value_store.h"
@@ -428,7 +429,7 @@ class PageLoadTest : public testing::Test {
// 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;
chrome::GetChromeFrameUserDataDirectory(&path);
PrefServiceMockBuilder builder;
@@ -436,20 +437,22 @@ class PageLoadTest : public testing::Test {
path,
JsonPrefStore::GetTaskRunnerForFile(
path, content::BrowserThread::GetBlockingPool()));
- 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_frame/test/net/fake_external_tab.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698