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

Unified Diff: chrome/browser/metrics/metrics_service_uitest.cc

Issue 5646003: Sanitize PrefStore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefService mock construction in PrefServiceTest to include command line store. Created 10 years 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
Index: chrome/browser/metrics/metrics_service_uitest.cc
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc
index 93889c586788bab047d156a8a927038b0f91d783..4d67c135e36ebf65c99ffc6e743b851168d0a727 100644
--- a/chrome/browser/metrics/metrics_service_uitest.cc
+++ b/chrome/browser/metrics/metrics_service_uitest.cc
@@ -13,14 +13,15 @@
#include "base/platform_thread.h"
#include "chrome/browser/browser_thread.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"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/json_pref_store.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/automation/browser_proxy.h"
+#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
#include "net/base/net_util.h"
@@ -51,10 +52,8 @@ class MetricsServiceTest : public UITest {
// that was saved by the app as it closed. The caller takes ownership of the
// returned PrefService object.
PrefService* GetLocalState() {
- FilePath local_state_path = user_data_dir()
- .Append(chrome::kLocalStateFilename);
-
- return PrefService::CreateUserPrefService(local_state_path);
+ FilePath path = user_data_dir().Append(chrome::kLocalStateFilename);
+ return PrefServiceMockBuilder().WithUserFilePrefs(path).Create();
}
};
« no previous file with comments | « chrome/browser/extensions/test_extension_prefs.cc ('k') | chrome/browser/net/pref_proxy_config_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698