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

Side by Side Diff: sync/engine/sync_scheduler_unittest.cc

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 virtual void SetUp() { 102 virtual void SetUp() {
103 dir_maker_.SetUp(); 103 dir_maker_.SetUp();
104 syncer_ = new MockSyncer(); 104 syncer_ = new MockSyncer();
105 delay_ = NULL; 105 delay_ = NULL;
106 106
107 ModelSafeRoutingInfo routing_info; 107 ModelSafeRoutingInfo routing_info;
108 routing_info[BOOKMARKS] = GROUP_UI; 108 routing_info[BOOKMARKS] = GROUP_UI;
109 routing_info[AUTOFILL] = GROUP_DB; 109 routing_info[AUTOFILL] = GROUP_DB;
110 routing_info[THEMES] = GROUP_UI; 110 routing_info[THEMES] = GROUP_UI;
111 routing_info[NIGORI] = GROUP_PASSIVE; 111 routing_info[NIGORI] = GROUP_CONTROL;
112 112
113 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI))); 113 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI)));
114 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_DB))); 114 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_DB)));
115 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE))); 115 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE)));
116 workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_CONTROL)));
116 117
117 std::vector<ModelSafeWorker*> workers; 118 std::vector<ModelSafeWorker*> workers;
118 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it = 119 for (std::vector<scoped_refptr<FakeModelWorker> >::iterator it =
119 workers_.begin(); it != workers_.end(); ++it) { 120 workers_.begin(); it != workers_.end(); ++it) {
120 workers.push_back(it->get()); 121 workers.push_back(it->get());
121 } 122 }
122 123
123 connection_.reset(new MockConnectionManager(directory())); 124 connection_.reset(new MockConnectionManager(directory()));
124 connection_->SetServerReachable(); 125 connection_->SetServerReachable();
125 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL)); 126 throttled_data_type_tracker_.reset(new ThrottledDataTypeTracker(NULL));
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 // Should save the nudge for until after the server is reachable. 1117 // Should save the nudge for until after the server is reachable.
1117 MessageLoop::current()->RunAllPending(); 1118 MessageLoop::current()->RunAllPending();
1118 1119
1119 connection()->SetServerReachable(); 1120 connection()->SetServerReachable();
1120 connection()->UpdateConnectionStatus(); 1121 connection()->UpdateConnectionStatus();
1121 scheduler()->OnConnectionStatusChange(); 1122 scheduler()->OnConnectionStatusChange();
1122 MessageLoop::current()->RunAllPending(); 1123 MessageLoop::current()->RunAllPending();
1123 } 1124 }
1124 1125
1125 } // namespace syncer 1126 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698