OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/basictypes.h" |
| 6 #include "base/memory/ref_counted.h" |
| 7 #include "chrome/browser/sync/engine/resolve_conflicts_command.h" |
| 8 #include "chrome/browser/sync/sessions/sync_session.h" |
| 9 #include "chrome/browser/sync/syncable/model_type.h" |
| 10 #include "chrome/browser/sync/syncable/syncable_id.h" |
| 11 #include "chrome/browser/sync/test/engine/fake_model_worker.h" |
| 12 #include "chrome/browser/sync/test/engine/syncer_command_test.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 |
| 15 namespace browser_sync { |
| 16 |
| 17 namespace { |
| 18 |
| 19 class ResolveConflictsCommandTest : public SyncerCommandTest { |
| 20 protected: |
| 21 ResolveConflictsCommandTest() {} |
| 22 virtual ~ResolveConflictsCommandTest() {} |
| 23 |
| 24 virtual void SetUp() { |
| 25 workers()->push_back( |
| 26 make_scoped_refptr(new FakeModelWorker(GROUP_UI))); |
| 27 workers()->push_back( |
| 28 make_scoped_refptr(new FakeModelWorker(GROUP_PASSWORD))); |
| 29 (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; |
| 30 (*mutable_routing_info())[syncable::PASSWORDS] = GROUP_PASSWORD; |
| 31 SyncerCommandTest::SetUp(); |
| 32 } |
| 33 |
| 34 ResolveConflictsCommand command_; |
| 35 |
| 36 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(ResolveConflictsCommandTest); |
| 38 }; |
| 39 |
| 40 TEST_F(ResolveConflictsCommandTest, GetGroupsToChange) { |
| 41 ExpectNoGroupsToChange(command_); |
| 42 // Put GROUP_PASSWORD in conflict. |
| 43 session()->mutable_status_controller()-> |
| 44 GetUnrestrictedMutableConflictProgressForTest(GROUP_PASSWORD)-> |
| 45 AddConflictingItemById(syncable::Id()); |
| 46 ExpectGroupToChange(command_, GROUP_PASSWORD); |
| 47 } |
| 48 |
| 49 } // namespace |
| 50 |
| 51 } // namespace browser_sync |
OLD | NEW |