OLD | NEW |
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 // Syncer unit tests. Unfortunately a lot of these tests | 5 // Syncer unit tests. Unfortunately a lot of these tests |
6 // are outdated and need to be reworked and updated. | 6 // are outdated and need to be reworked and updated. |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <limits> | 9 #include <limits> |
10 #include <list> | 10 #include <list> |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 virtual void SetUp() { | 193 virtual void SetUp() { |
194 syncdb_.SetUp(); | 194 syncdb_.SetUp(); |
195 | 195 |
196 mock_server_.reset( | 196 mock_server_.reset( |
197 new MockConnectionManager(syncdb_.manager(), syncdb_.name())); | 197 new MockConnectionManager(syncdb_.manager(), syncdb_.name())); |
198 EnableDatatype(syncable::BOOKMARKS); | 198 EnableDatatype(syncable::BOOKMARKS); |
199 worker_ = new ModelSafeWorker(); | 199 worker_ = new ModelSafeWorker(); |
200 std::vector<SyncEngineEventListener*> listeners; | 200 std::vector<SyncEngineEventListener*> listeners; |
201 listeners.push_back(this); | 201 listeners.push_back(this); |
202 context_.reset(new SyncSessionContext(mock_server_.get(), | 202 context_.reset(new SyncSessionContext(mock_server_.get(), |
203 syncdb_.manager(), this, listeners, NULL)); | 203 syncdb_.manager(), this, listeners)); |
204 context_->set_account_name(syncdb_.name()); | 204 context_->set_account_name(syncdb_.name()); |
205 ASSERT_FALSE(context_->resolver()); | 205 ASSERT_FALSE(context_->resolver()); |
206 syncer_ = new Syncer(); | 206 syncer_ = new Syncer(); |
207 session_.reset(MakeSession()); | 207 session_.reset(MakeSession()); |
208 | 208 |
209 ScopedDirLookup dir(syncdb_.manager(), syncdb_.name()); | 209 ScopedDirLookup dir(syncdb_.manager(), syncdb_.name()); |
210 CHECK(dir.good()); | 210 CHECK(dir.good()); |
211 ReadTransaction trans(FROM_HERE, dir); | 211 ReadTransaction trans(FROM_HERE, dir); |
212 syncable::Directory::ChildHandles children; | 212 syncable::Directory::ChildHandles children; |
213 dir->GetChildHandlesById(&trans, trans.root_id(), &children); | 213 dir->GetChildHandlesById(&trans, trans.root_id(), &children); |
(...skipping 5032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5246 Add(low_id_); | 5246 Add(low_id_); |
5247 Add(high_id_); | 5247 Add(high_id_); |
5248 SyncShareAsDelegate(); | 5248 SyncShareAsDelegate(); |
5249 ExpectLocalOrderIsByServerId(); | 5249 ExpectLocalOrderIsByServerId(); |
5250 } | 5250 } |
5251 | 5251 |
5252 const SyncerTest::CommitOrderingTest | 5252 const SyncerTest::CommitOrderingTest |
5253 SyncerTest::CommitOrderingTest::LAST_COMMIT_ITEM = {-1, TestIdFactory::root()}; | 5253 SyncerTest::CommitOrderingTest::LAST_COMMIT_ITEM = {-1, TestIdFactory::root()}; |
5254 | 5254 |
5255 } // namespace browser_sync | 5255 } // namespace browser_sync |
OLD | NEW |