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 #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 "chrome/browser/sync/engine/model_changing_syncer_command.h" | 8 #include "chrome/browser/sync/engine/model_changing_syncer_command.h" |
9 #include "chrome/browser/sync/sessions/sync_session.h" | 9 #include "chrome/browser/sync/sessions/sync_session.h" |
10 #include "chrome/browser/sync/syncable/model_type.h" | 10 #include "chrome/browser/sync/syncable/model_type.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 const std::set<ModelSafeGroup>& changed_groups() const { | 24 const std::set<ModelSafeGroup>& changed_groups() const { |
25 return changed_groups_; | 25 return changed_groups_; |
26 } | 26 } |
27 | 27 |
28 protected: | 28 protected: |
29 virtual std::set<ModelSafeGroup> GetGroupsToChange( | 29 virtual std::set<ModelSafeGroup> GetGroupsToChange( |
30 const sessions::SyncSession& session) const OVERRIDE { | 30 const sessions::SyncSession& session) const OVERRIDE { |
31 return session.GetEnabledGroups(); | 31 return session.GetEnabledGroups(); |
32 } | 32 } |
33 | 33 |
34 virtual void ModelChangingExecuteImpl( | 34 virtual SyncerError ModelChangingExecuteImpl( |
35 sessions::SyncSession* session) OVERRIDE { | 35 sessions::SyncSession* session) OVERRIDE { |
36 changed_groups_.insert(session->status_controller().group_restriction()); | 36 changed_groups_.insert(session->status_controller().group_restriction()); |
| 37 return NO_ERROR; |
37 } | 38 } |
38 | 39 |
39 private: | 40 private: |
40 std::set<ModelSafeGroup> changed_groups_; | 41 std::set<ModelSafeGroup> changed_groups_; |
41 | 42 |
42 DISALLOW_COPY_AND_ASSIGN(FakeModelChangingSyncerCommand); | 43 DISALLOW_COPY_AND_ASSIGN(FakeModelChangingSyncerCommand); |
43 }; | 44 }; |
44 | 45 |
45 class ModelChangingSyncerCommandTest : public SyncerCommandTest { | 46 class ModelChangingSyncerCommandTest : public SyncerCommandTest { |
46 protected: | 47 protected: |
(...skipping 20 matching lines...) Expand all Loading... |
67 ExpectGroupsToChange(command_, GROUP_UI, GROUP_PASSWORD, GROUP_PASSIVE); | 68 ExpectGroupsToChange(command_, GROUP_UI, GROUP_PASSWORD, GROUP_PASSIVE); |
68 EXPECT_TRUE(command_.changed_groups().empty()); | 69 EXPECT_TRUE(command_.changed_groups().empty()); |
69 command_.ExecuteImpl(session()); | 70 command_.ExecuteImpl(session()); |
70 EXPECT_EQ(command_.GetGroupsToChangeForTest(*session()), | 71 EXPECT_EQ(command_.GetGroupsToChangeForTest(*session()), |
71 command_.changed_groups()); | 72 command_.changed_groups()); |
72 } | 73 } |
73 | 74 |
74 } // namespace | 75 } // namespace |
75 | 76 |
76 } // namespace browser_sync | 77 } // namespace browser_sync |
OLD | NEW |