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

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

Issue 11445002: Sync user's custom spellcheck dictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge master Created 7 years, 11 months 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
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/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "chrome/test/base/testing_pref_service.h" 9 #include "chrome/test/base/testing_pref_service.h"
10 #include "sync/internal_api/public/base/model_type.h" 10 #include "sync/internal_api/public/base/model_type.h"
(...skipping 18 matching lines...) Expand all
29 private: 29 private:
30 MessageLoop loop_; 30 MessageLoop loop_;
31 }; 31 };
32 32
33 // Returns all types visible from the setup UI. 33 // Returns all types visible from the setup UI.
34 syncer::ModelTypeSet GetUserVisibleTypes() { 34 syncer::ModelTypeSet GetUserVisibleTypes() {
35 syncer::ModelTypeSet user_visible_types(syncer::UserTypes()); 35 syncer::ModelTypeSet user_visible_types(syncer::UserTypes());
36 user_visible_types.Remove(syncer::APP_NOTIFICATIONS); 36 user_visible_types.Remove(syncer::APP_NOTIFICATIONS);
37 user_visible_types.Remove(syncer::APP_SETTINGS); 37 user_visible_types.Remove(syncer::APP_SETTINGS);
38 user_visible_types.Remove(syncer::AUTOFILL_PROFILE); 38 user_visible_types.Remove(syncer::AUTOFILL_PROFILE);
39 user_visible_types.Remove(syncer::DICTIONARY);
39 user_visible_types.Remove(syncer::EXTENSION_SETTINGS); 40 user_visible_types.Remove(syncer::EXTENSION_SETTINGS);
40 user_visible_types.Remove(syncer::SEARCH_ENGINES); 41 user_visible_types.Remove(syncer::SEARCH_ENGINES);
41 return user_visible_types; 42 return user_visible_types;
42 } 43 }
43 44
44 TEST_F(SyncPrefsTest, Basic) { 45 TEST_F(SyncPrefsTest, Basic) {
45 SyncPrefs sync_prefs(&pref_service_); 46 SyncPrefs sync_prefs(&pref_service_);
46 47
47 EXPECT_FALSE(sync_prefs.HasSyncSetupCompleted()); 48 EXPECT_FALSE(sync_prefs.HasSyncSetupCompleted());
48 sync_prefs.SetSyncSetupCompleted(); 49 sync_prefs.SetSyncSetupCompleted();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const syncer::ModelTypeSet user_visible_types = GetUserVisibleTypes(); 101 const syncer::ModelTypeSet user_visible_types = GetUserVisibleTypes();
101 for (syncer::ModelTypeSet::Iterator it = user_visible_types.First(); 102 for (syncer::ModelTypeSet::Iterator it = user_visible_types.First();
102 it.Good(); it.Inc()) { 103 it.Good(); it.Inc()) {
103 syncer::ModelTypeSet preferred_types; 104 syncer::ModelTypeSet preferred_types;
104 preferred_types.Put(it.Get()); 105 preferred_types.Put(it.Get());
105 syncer::ModelTypeSet expected_preferred_types(preferred_types); 106 syncer::ModelTypeSet expected_preferred_types(preferred_types);
106 if (it.Get() == syncer::AUTOFILL) { 107 if (it.Get() == syncer::AUTOFILL) {
107 expected_preferred_types.Put(syncer::AUTOFILL_PROFILE); 108 expected_preferred_types.Put(syncer::AUTOFILL_PROFILE);
108 } 109 }
109 if (it.Get() == syncer::PREFERENCES) { 110 if (it.Get() == syncer::PREFERENCES) {
111 expected_preferred_types.Put(syncer::DICTIONARY);
110 expected_preferred_types.Put(syncer::SEARCH_ENGINES); 112 expected_preferred_types.Put(syncer::SEARCH_ENGINES);
111 } 113 }
112 if (it.Get() == syncer::APPS) { 114 if (it.Get() == syncer::APPS) {
113 expected_preferred_types.Put(syncer::APP_NOTIFICATIONS); 115 expected_preferred_types.Put(syncer::APP_NOTIFICATIONS);
114 expected_preferred_types.Put(syncer::APP_SETTINGS); 116 expected_preferred_types.Put(syncer::APP_SETTINGS);
115 } 117 }
116 if (it.Get() == syncer::EXTENSIONS) { 118 if (it.Get() == syncer::EXTENSIONS) {
117 expected_preferred_types.Put(syncer::EXTENSION_SETTINGS); 119 expected_preferred_types.Put(syncer::EXTENSION_SETTINGS);
118 } 120 }
119 if (it.Get() == syncer::SESSIONS) { 121 if (it.Get() == syncer::SESSIONS) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 EXPECT_FALSE(sync_prefs.HasKeepEverythingSynced()); 203 EXPECT_FALSE(sync_prefs.HasKeepEverythingSynced());
202 const syncer::ModelTypeSet user_types = syncer::UserTypes(); 204 const syncer::ModelTypeSet user_types = syncer::UserTypes();
203 EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(user_types).Empty()); 205 EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(user_types).Empty());
204 EXPECT_FALSE(sync_prefs.IsManaged()); 206 EXPECT_FALSE(sync_prefs.IsManaged());
205 EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty()); 207 EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty());
206 } 208 }
207 209
208 } // namespace 210 } // namespace
209 211
210 } // namespace browser_sync 212 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_prefs.cc ('k') | chrome/browser/sync/test/integration/dictionary_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698