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

Side by Side Diff: chrome/browser/sync/sync_prefs_unittest.cc

Issue 59793008: sync: don't allow NULL profile in ProfileSyncService and friends (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/sync_prefs.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sync/sync_prefs.h" 5 #include "chrome/browser/sync/sync_prefs.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 EXPECT_NE(base::Time(), sync_prefs.GetLastSyncedTime()); 225 EXPECT_NE(base::Time(), sync_prefs.GetLastSyncedTime());
226 EXPECT_EQ("token", sync_prefs.GetEncryptionBootstrapToken()); 226 EXPECT_EQ("token", sync_prefs.GetEncryptionBootstrapToken());
227 227
228 sync_prefs.ClearPreferences(); 228 sync_prefs.ClearPreferences();
229 229
230 EXPECT_FALSE(sync_prefs.HasSyncSetupCompleted()); 230 EXPECT_FALSE(sync_prefs.HasSyncSetupCompleted());
231 EXPECT_EQ(base::Time(), sync_prefs.GetLastSyncedTime()); 231 EXPECT_EQ(base::Time(), sync_prefs.GetLastSyncedTime());
232 EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty()); 232 EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty());
233 } 233 }
234 234
235 TEST_F(SyncPrefsTest, NullPrefService) {
236 SyncPrefs sync_prefs(NULL);
237
238 EXPECT_FALSE(sync_prefs.HasSyncSetupCompleted());
239 EXPECT_FALSE(sync_prefs.IsStartSuppressed());
240 EXPECT_EQ(base::Time(), sync_prefs.GetLastSyncedTime());
241 EXPECT_FALSE(sync_prefs.HasKeepEverythingSynced());
242 const syncer::ModelTypeSet user_types = syncer::UserTypes();
243 EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(user_types).Empty());
244 EXPECT_FALSE(sync_prefs.IsManaged());
245 EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty());
246 }
247
248 } // namespace 235 } // namespace
249 236
250 } // namespace browser_sync 237 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_prefs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698