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> |
11 #include <map> | 11 #include <map> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/location.h" | 17 #include "base/location.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "base/message_loop.h" |
19 #include "base/string_number_conversions.h" | 20 #include "base/string_number_conversions.h" |
20 #include "base/stringprintf.h" | 21 #include "base/stringprintf.h" |
21 #include "base/time.h" | 22 #include "base/time.h" |
22 #include "build/build_config.h" | 23 #include "build/build_config.h" |
23 #include "chrome/browser/sync/engine/conflict_resolver.h" | 24 #include "chrome/browser/sync/engine/conflict_resolver.h" |
24 #include "chrome/browser/sync/engine/get_commit_ids_command.h" | 25 #include "chrome/browser/sync/engine/get_commit_ids_command.h" |
25 #include "chrome/browser/sync/engine/model_safe_worker.h" | 26 #include "chrome/browser/sync/engine/model_safe_worker.h" |
26 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 27 #include "chrome/browser/sync/engine/net/server_connection_manager.h" |
27 #include "chrome/browser/sync/engine/process_updates_command.h" | 28 #include "chrome/browser/sync/engine/process_updates_command.h" |
28 #include "chrome/browser/sync/engine/nigori_util.h" | 29 #include "chrome/browser/sync/engine/nigori_util.h" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 462 } |
462 | 463 |
463 bool Get(int64 metahandle, syncable::IsDelField field) const { | 464 bool Get(int64 metahandle, syncable::IsDelField field) const { |
464 return GetField(metahandle, field, false); | 465 return GetField(metahandle, field, false); |
465 } | 466 } |
466 | 467 |
467 bool Get(int64 metahandle, syncable::BitField field) const { | 468 bool Get(int64 metahandle, syncable::BitField field) const { |
468 return GetField(metahandle, field, false); | 469 return GetField(metahandle, field, false); |
469 } | 470 } |
470 | 471 |
| 472 MessageLoop message_loop_; |
| 473 |
471 // Some ids to aid tests. Only the root one's value is specific. The rest | 474 // Some ids to aid tests. Only the root one's value is specific. The rest |
472 // are named for test clarity. | 475 // are named for test clarity. |
473 // TODO(chron): Get rid of these inbuilt IDs. They only make it | 476 // TODO(chron): Get rid of these inbuilt IDs. They only make it |
474 // more confusing. | 477 // more confusing. |
475 syncable::Id root_id_; | 478 syncable::Id root_id_; |
476 syncable::Id parent_id_; | 479 syncable::Id parent_id_; |
477 syncable::Id child_id_; | 480 syncable::Id child_id_; |
478 | 481 |
479 TestIdFactory ids_; | 482 TestIdFactory ids_; |
480 | 483 |
(...skipping 4817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5298 Add(low_id_); | 5301 Add(low_id_); |
5299 Add(high_id_); | 5302 Add(high_id_); |
5300 SyncShareAsDelegate(); | 5303 SyncShareAsDelegate(); |
5301 ExpectLocalOrderIsByServerId(); | 5304 ExpectLocalOrderIsByServerId(); |
5302 } | 5305 } |
5303 | 5306 |
5304 const SyncerTest::CommitOrderingTest | 5307 const SyncerTest::CommitOrderingTest |
5305 SyncerTest::CommitOrderingTest::LAST_COMMIT_ITEM = {-1, TestIdFactory::root()}; | 5308 SyncerTest::CommitOrderingTest::LAST_COMMIT_ITEM = {-1, TestIdFactory::root()}; |
5306 | 5309 |
5307 } // namespace browser_sync | 5310 } // namespace browser_sync |
OLD | NEW |