| OLD | NEW |
| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "sync/engine/model_changing_syncer_command.h" | 8 #include "sync/engine/model_changing_syncer_command.h" |
| 9 #include "sync/internal_api/public/base/model_type.h" | 9 #include "sync/internal_api/public/base/model_type.h" |
| 10 #include "sync/sessions/sync_session.h" | 10 #include "sync/sessions/sync_session.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class ModelChangingSyncerCommandTest : public SyncerCommandTest { | 46 class ModelChangingSyncerCommandTest : public SyncerCommandTest { |
| 47 protected: | 47 protected: |
| 48 ModelChangingSyncerCommandTest() {} | 48 ModelChangingSyncerCommandTest() {} |
| 49 virtual ~ModelChangingSyncerCommandTest() {} | 49 virtual ~ModelChangingSyncerCommandTest() {} |
| 50 | 50 |
| 51 virtual void SetUp() { | 51 virtual void SetUp() { |
| 52 workers()->push_back( | 52 workers()->push_back( |
| 53 make_scoped_refptr(new FakeModelWorker(GROUP_UI))); | 53 make_scoped_refptr(new FakeModelWorker(GROUP_UI))); |
| 54 workers()->push_back( | 54 workers()->push_back( |
| 55 make_scoped_refptr(new FakeModelWorker(GROUP_PASSWORD))); | 55 make_scoped_refptr(new FakeModelWorker(GROUP_PASSWORD))); |
| 56 (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; | 56 (*mutable_routing_info())[BOOKMARKS] = GROUP_UI; |
| 57 (*mutable_routing_info())[syncer::PASSWORDS] = GROUP_PASSWORD; | 57 (*mutable_routing_info())[PASSWORDS] = GROUP_PASSWORD; |
| 58 SyncerCommandTest::SetUp(); | 58 SyncerCommandTest::SetUp(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 FakeModelChangingSyncerCommand command_; | 61 FakeModelChangingSyncerCommand command_; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 DISALLOW_COPY_AND_ASSIGN(ModelChangingSyncerCommandTest); | 64 DISALLOW_COPY_AND_ASSIGN(ModelChangingSyncerCommandTest); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 TEST_F(ModelChangingSyncerCommandTest, Basic) { | 67 TEST_F(ModelChangingSyncerCommandTest, Basic) { |
| 68 ExpectGroupsToChange(command_, GROUP_UI, GROUP_PASSWORD, GROUP_PASSIVE); | 68 ExpectGroupsToChange(command_, GROUP_UI, GROUP_PASSWORD, GROUP_PASSIVE); |
| 69 EXPECT_TRUE(command_.changed_groups().empty()); | 69 EXPECT_TRUE(command_.changed_groups().empty()); |
| 70 command_.ExecuteImpl(session()); | 70 command_.ExecuteImpl(session()); |
| 71 EXPECT_EQ(command_.GetGroupsToChangeForTest(*session()), | 71 EXPECT_EQ(command_.GetGroupsToChangeForTest(*session()), |
| 72 command_.changed_groups()); | 72 command_.changed_groups()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 } // namespace syncer | 77 } // namespace syncer |
| OLD | NEW |