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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_registrar_unittest.cc

Issue 7891054: Add GROUP_FILE ModelSafeGroup (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix worker count in unittest Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_registrar.cc ('k') | chrome/chrome_browser.gypi » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/glue/sync_backend_registrar.h" 5 #include "chrome/browser/sync/glue/sync_backend_registrar.h"
6 6
7 #include "chrome/browser/sync/glue/change_processor_mock.h" 7 #include "chrome/browser/sync/glue/change_processor_mock.h"
8 #include "chrome/browser/sync/glue/ui_model_worker.h" 8 #include "chrome/browser/sync/glue/ui_model_worker.h"
9 #include "chrome/browser/sync/syncable/model_type.h" 9 #include "chrome/browser/sync/syncable/model_type.h"
10 #include "chrome/browser/sync/test/engine/test_user_share.h" 10 #include "chrome/browser/sync/test/engine/test_user_share.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 BrowserThread ui_thread_; 72 BrowserThread ui_thread_;
73 }; 73 };
74 74
75 TEST_F(SyncBackendRegistrarTest, ConstructorEmpty) { 75 TEST_F(SyncBackendRegistrarTest, ConstructorEmpty) {
76 TestingProfile profile; 76 TestingProfile profile;
77 SyncBackendRegistrar registrar(ModelTypeSet(), "test", &profile, &loop_); 77 SyncBackendRegistrar registrar(ModelTypeSet(), "test", &profile, &loop_);
78 EXPECT_FALSE(registrar.IsNigoriEnabled()); 78 EXPECT_FALSE(registrar.IsNigoriEnabled());
79 { 79 {
80 std::vector<ModelSafeWorker*> workers; 80 std::vector<ModelSafeWorker*> workers;
81 registrar.GetWorkers(&workers); 81 registrar.GetWorkers(&workers);
82 EXPECT_EQ(3u, workers.size()); 82 EXPECT_EQ(4u, workers.size());
83 } 83 }
84 ExpectRoutingInfo(&registrar, ModelSafeRoutingInfo()); 84 ExpectRoutingInfo(&registrar, ModelSafeRoutingInfo());
85 ExpectHasProcessorsForTypes(&registrar, ModelTypeSet()); 85 ExpectHasProcessorsForTypes(&registrar, ModelTypeSet());
86 registrar.OnSyncerShutdownComplete(); 86 registrar.OnSyncerShutdownComplete();
87 registrar.StopOnUIThread(); 87 registrar.StopOnUIThread();
88 } 88 }
89 89
90 TEST_F(SyncBackendRegistrarTest, ConstructorNonEmpty) { 90 TEST_F(SyncBackendRegistrarTest, ConstructorNonEmpty) {
91 TestingProfile profile; 91 TestingProfile profile;
92 ModelTypeSet initial_types; 92 ModelTypeSet initial_types;
93 initial_types.insert(BOOKMARKS); 93 initial_types.insert(BOOKMARKS);
94 initial_types.insert(NIGORI); 94 initial_types.insert(NIGORI);
95 initial_types.insert(PASSWORDS); 95 initial_types.insert(PASSWORDS);
96 SyncBackendRegistrar registrar(initial_types, "test", &profile, &loop_); 96 SyncBackendRegistrar registrar(initial_types, "test", &profile, &loop_);
97 EXPECT_TRUE(registrar.IsNigoriEnabled()); 97 EXPECT_TRUE(registrar.IsNigoriEnabled());
98 { 98 {
99 std::vector<ModelSafeWorker*> workers; 99 std::vector<ModelSafeWorker*> workers;
100 registrar.GetWorkers(&workers); 100 registrar.GetWorkers(&workers);
101 EXPECT_EQ(3u, workers.size()); 101 EXPECT_EQ(4u, workers.size());
102 } 102 }
103 { 103 {
104 ModelSafeRoutingInfo expected_routing_info; 104 ModelSafeRoutingInfo expected_routing_info;
105 expected_routing_info[BOOKMARKS] = GROUP_PASSIVE; 105 expected_routing_info[BOOKMARKS] = GROUP_PASSIVE;
106 expected_routing_info[NIGORI] = GROUP_PASSIVE; 106 expected_routing_info[NIGORI] = GROUP_PASSIVE;
107 // Passwords dropped because of no password store. 107 // Passwords dropped because of no password store.
108 ExpectRoutingInfo(&registrar, expected_routing_info); 108 ExpectRoutingInfo(&registrar, expected_routing_info);
109 } 109 }
110 ExpectHasProcessorsForTypes(&registrar, ModelTypeSet()); 110 ExpectHasProcessorsForTypes(&registrar, ModelTypeSet());
111 registrar.OnSyncerShutdownComplete(); 111 registrar.OnSyncerShutdownComplete();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 registrar.OnSyncerShutdownComplete(); 219 registrar.OnSyncerShutdownComplete();
220 registrar.StopOnUIThread(); 220 registrar.StopOnUIThread();
221 } 221 }
222 222
223 // TODO(akalin): Add tests for non-UI non-passive data types (see 223 // TODO(akalin): Add tests for non-UI non-passive data types (see
224 // http://crbug.com/93456). 224 // http://crbug.com/93456).
225 225
226 } // namespace 226 } // namespace
227 227
228 } // namespace browser_sync 228 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_registrar.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698