| 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);
|
|
|