OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/engine/apply_updates_command.h" | 5 #include "chrome/browser/sync/engine/apply_updates_command.h" |
6 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 6 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" |
7 #include "chrome/browser/sync/sessions/sync_session.h" | 7 #include "chrome/browser/sync/sessions/sync_session.h" |
8 #include "chrome/browser/sync/syncable/directory_manager.h" | 8 #include "chrome/browser/sync/syncable/directory_manager.h" |
9 #include "chrome/browser/sync/syncable/syncable.h" | 9 #include "chrome/browser/sync/syncable/syncable.h" |
10 #include "chrome/browser/sync/syncable/syncable_id.h" | 10 #include "chrome/browser/sync/syncable/syncable_id.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // A test fixture for tests exercising ApplyUpdatesCommand. | 26 // A test fixture for tests exercising ApplyUpdatesCommand. |
27 class ApplyUpdatesCommandTest : public SyncerCommandTest { | 27 class ApplyUpdatesCommandTest : public SyncerCommandTest { |
28 public: | 28 public: |
29 protected: | 29 protected: |
30 ApplyUpdatesCommandTest() : next_revision_(1) {} | 30 ApplyUpdatesCommandTest() : next_revision_(1) {} |
31 virtual ~ApplyUpdatesCommandTest() {} | 31 virtual ~ApplyUpdatesCommandTest() {} |
32 | 32 |
33 virtual void SetUp() { | 33 virtual void SetUp() { |
34 workers()->clear(); | 34 workers()->clear(); |
35 mutable_routing_info()->clear(); | 35 mutable_routing_info()->clear(); |
36 workers()->push_back(new ModelSafeWorker()); // GROUP_PASSIVE worker. | 36 // GROUP_PASSIVE worker. |
| 37 workers()->push_back(make_scoped_refptr(new ModelSafeWorker())); |
37 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_PASSIVE; | 38 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_PASSIVE; |
38 (*mutable_routing_info())[syncable::PASSWORDS] = GROUP_PASSIVE; | 39 (*mutable_routing_info())[syncable::PASSWORDS] = GROUP_PASSIVE; |
39 (*mutable_routing_info())[syncable::NIGORI] = GROUP_PASSIVE; | 40 (*mutable_routing_info())[syncable::NIGORI] = GROUP_PASSIVE; |
40 SyncerCommandTest::SetUp(); | 41 SyncerCommandTest::SetUp(); |
41 } | 42 } |
42 | 43 |
43 // Create a new unapplied update. | 44 // Create a new unapplied update. |
44 void CreateUnappliedNewItemWithParent(const string& item_id, | 45 void CreateUnappliedNewItemWithParent(const string& item_id, |
45 const string& parent_id) { | 46 const string& parent_id) { |
46 ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); | 47 ScopedDirLookup dir(syncdb()->manager(), syncdb()->name()); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 EXPECT_EQ(0, status->conflict_progress().ConflictingItemsSize()) | 279 EXPECT_EQ(0, status->conflict_progress().ConflictingItemsSize()) |
279 << "The nigori update shouldn't be in conflict"; | 280 << "The nigori update shouldn't be in conflict"; |
280 EXPECT_EQ(1, status->update_progress().SuccessfullyAppliedUpdateCount()) | 281 EXPECT_EQ(1, status->update_progress().SuccessfullyAppliedUpdateCount()) |
281 << "The nigori update should be applied"; | 282 << "The nigori update should be applied"; |
282 | 283 |
283 EXPECT_FALSE(cryptographer->is_ready()); | 284 EXPECT_FALSE(cryptographer->is_ready()); |
284 EXPECT_TRUE(cryptographer->has_pending_keys()); | 285 EXPECT_TRUE(cryptographer->has_pending_keys()); |
285 } | 286 } |
286 | 287 |
287 } // namespace browser_sync | 288 } // namespace browser_sync |
OLD | NEW |