summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/shown_sections_handler_unittest.cc
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 13:54:08 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 13:54:08 +0000
commit74379bc51320fd98a47c98053a056b4ddd7271a7 (patch)
tree721fb4cbad36a304162745d8a0a5ee0930f054f0 /chrome/browser/dom_ui/shown_sections_handler_unittest.cc
parent7082b2329218da9a77fd6bc9587e86d0ed817196 (diff)
downloadchromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.zip
chromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.tar.gz
chromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.tar.bz2
Adjust preference sync code to only sync user modifiable preferences.
Switch to the new preference value source checkers in Preference. While at it, add a unit test and better test infrastructure for controlling preference values in tests. Convert existing unit tests where appropriate. BUG=48952 TEST=ProfileSyncServicePreferenceTest.ManagedPreferences Review URL: http://codereview.chromium.org/3051001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/shown_sections_handler_unittest.cc')
-rw-r--r--chrome/browser/dom_ui/shown_sections_handler_unittest.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/dom_ui/shown_sections_handler_unittest.cc b/chrome/browser/dom_ui/shown_sections_handler_unittest.cc
index 42fa47a..934c55a 100644
--- a/chrome/browser/dom_ui/shown_sections_handler_unittest.cc
+++ b/chrome/browser/dom_ui/shown_sections_handler_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,20 +7,17 @@
#include "base/file_path.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/chrome_thread.h"
-#include "chrome/browser/pref_service.h"
#include "chrome/browser/pref_value_store.h"
#include "chrome/common/json_pref_store.h"
#include "chrome/common/pref_names.h"
+#include "chrome/test/testing_pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
class ShownSectionsHandlerTest : public testing::Test {
};
TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) {
- // Create a preference value that has only user defined
- // preference values.
- FilePath user_prefs = FilePath();
- scoped_ptr<PrefService> pref(PrefService::CreateUserPrefService(user_prefs));
+ scoped_ptr<PrefService> pref(new TestingPrefService);
// Set an *old* value
pref->RegisterIntegerPref(prefs::kNTPShownSections, 0);
@@ -38,8 +35,7 @@ TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) {
}
TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs1To2) {
- FilePath user_prefs = FilePath();
- scoped_ptr<PrefService> pref(PrefService::CreateUserPrefService(user_prefs));
+ scoped_ptr<PrefService> pref(new TestingPrefService);
// Set an *old* value
pref->RegisterIntegerPref(prefs::kNTPShownSections, 0);
@@ -52,4 +48,3 @@ TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs1To2) {
EXPECT_TRUE(shown_sections & THUMB);
EXPECT_FALSE(shown_sections & LIST);
}
-