summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 20:49:52 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 20:49:52 +0000
commita82ac135a3453615f7289b5fbacc512576858639 (patch)
tree0cd7c9f5be025337645014f8a7f981367d8d511a /chrome
parent3d10fbfc4f656cb342171aa3cdbe7723c0bb5cec (diff)
downloadchromium_src-a82ac135a3453615f7289b5fbacc512576858639.zip
chromium_src-a82ac135a3453615f7289b5fbacc512576858639.tar.gz
chromium_src-a82ac135a3453615f7289b5fbacc512576858639.tar.bz2
Sync tests cleanup, consolidate Encryptor mock calls into fixture SetUp
This is follow-up from review http://codereview.chromium.org/2835041. BUG=none TEST=UserSettingsTest.PersistEmptyToken, UserSettingsTest.PersistNonEmptyToken Review URL: http://codereview.chromium.org/2854049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/util/user_settings_unittest.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/chrome/browser/sync/util/user_settings_unittest.cc b/chrome/browser/sync/util/user_settings_unittest.cc
index 1b12ef7..36af0e8 100644
--- a/chrome/browser/sync/util/user_settings_unittest.cc
+++ b/chrome/browser/sync/util/user_settings_unittest.cc
@@ -31,6 +31,14 @@ class UserSettingsTest : public testing::Test {
public:
UserSettingsTest() : sync_data_("Some sync data") { }
+ virtual void SetUp() {
+#if defined(OS_MACOSX)
+ // Need to mock the Keychain for unit tests on Mac to avoid possible
+ // blocking UI. |SetAuthTokenForService| uses Encryptor.
+ Encryptor::UseMockKeychain(true);
+#endif
+ }
+
// Creates and populates the V10 database files within
// |destination_directory|.
void SetUpVersion10Databases(const FilePath& destination_directory) {
@@ -232,11 +240,6 @@ TEST_F(UserSettingsTest, PersistEmptyToken) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
UserSettings settings;
settings.Init(temp_dir.path().AppendASCII("UserSettings.sqlite3"));
-#if defined(OS_MACOSX)
- // Need to mock the Keychain for unit tests on Mac to avoid possible
- // blocking UI. |SetAuthTokenForService| uses Encryptor.
- Encryptor::UseMockKeychain(true);
-#endif
settings.SetAuthTokenForService("username", "service", "");
std::string username;
std::string token;
@@ -251,11 +254,6 @@ TEST_F(UserSettingsTest, PersistNonEmptyToken) {
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
UserSettings settings;
settings.Init(temp_dir.path().AppendASCII("UserSettings.sqlite3"));
-#if defined(OS_MACOSX)
- // Need to mock the Keychain for unit tests on Mac to avoid possible
- // blocking UI. |SetAuthTokenForService| uses Encryptor.
- Encryptor::UseMockKeychain(true);
-#endif
settings.SetAuthTokenForService("username", "service", "012345beefbeef");
std::string username;
std::string token;