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 "chrome/browser/sync/test/integration/dictionary_helper.h" | 5 #include "chrome/browser/sync/test/integration/dictionary_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 namespace { | 101 namespace { |
102 | 102 |
103 // Helper class used in the implementation of AwaitDictionariesMatch. | 103 // Helper class used in the implementation of AwaitDictionariesMatch. |
104 class DictionaryMatchStatusChecker : public MultiClientStatusChangeChecker { | 104 class DictionaryMatchStatusChecker : public MultiClientStatusChangeChecker { |
105 public: | 105 public: |
106 DictionaryMatchStatusChecker(); | 106 DictionaryMatchStatusChecker(); |
107 virtual ~DictionaryMatchStatusChecker(); | 107 virtual ~DictionaryMatchStatusChecker(); |
108 | 108 |
109 virtual bool IsExitConditionSatisfied() OVERRIDE; | 109 virtual bool IsExitConditionSatisfied() override; |
110 virtual std::string GetDebugMessage() const OVERRIDE; | 110 virtual std::string GetDebugMessage() const override; |
111 }; | 111 }; |
112 | 112 |
113 DictionaryMatchStatusChecker::DictionaryMatchStatusChecker() | 113 DictionaryMatchStatusChecker::DictionaryMatchStatusChecker() |
114 : MultiClientStatusChangeChecker( | 114 : MultiClientStatusChangeChecker( |
115 sync_datatype_helper::test()->GetSyncServices()) {} | 115 sync_datatype_helper::test()->GetSyncServices()) {} |
116 | 116 |
117 DictionaryMatchStatusChecker::~DictionaryMatchStatusChecker() {} | 117 DictionaryMatchStatusChecker::~DictionaryMatchStatusChecker() {} |
118 | 118 |
119 bool DictionaryMatchStatusChecker::IsExitConditionSatisfied() { | 119 bool DictionaryMatchStatusChecker::IsExitConditionSatisfied() { |
120 return DictionariesMatch(); | 120 return DictionariesMatch(); |
121 } | 121 } |
122 | 122 |
123 std::string DictionaryMatchStatusChecker::GetDebugMessage() const { | 123 std::string DictionaryMatchStatusChecker::GetDebugMessage() const { |
124 return "Waiting for matching dictionaries"; | 124 return "Waiting for matching dictionaries"; |
125 } | 125 } |
126 | 126 |
127 // Helper class used in the implementation of AwaitNumDictionaryEntries. | 127 // Helper class used in the implementation of AwaitNumDictionaryEntries. |
128 class NumDictionaryEntriesStatusChecker | 128 class NumDictionaryEntriesStatusChecker |
129 : public SingleClientStatusChangeChecker { | 129 : public SingleClientStatusChangeChecker { |
130 public: | 130 public: |
131 NumDictionaryEntriesStatusChecker(int index, size_t num_words); | 131 NumDictionaryEntriesStatusChecker(int index, size_t num_words); |
132 virtual ~NumDictionaryEntriesStatusChecker(); | 132 virtual ~NumDictionaryEntriesStatusChecker(); |
133 | 133 |
134 virtual bool IsExitConditionSatisfied() OVERRIDE; | 134 virtual bool IsExitConditionSatisfied() override; |
135 virtual std::string GetDebugMessage() const OVERRIDE; | 135 virtual std::string GetDebugMessage() const override; |
136 private: | 136 private: |
137 int index_; | 137 int index_; |
138 size_t num_words_; | 138 size_t num_words_; |
139 }; | 139 }; |
140 | 140 |
141 NumDictionaryEntriesStatusChecker::NumDictionaryEntriesStatusChecker( | 141 NumDictionaryEntriesStatusChecker::NumDictionaryEntriesStatusChecker( |
142 int index, size_t num_words) | 142 int index, size_t num_words) |
143 : SingleClientStatusChangeChecker( | 143 : SingleClientStatusChangeChecker( |
144 sync_datatype_helper::test()->GetSyncService(index)), | 144 sync_datatype_helper::test()->GetSyncService(index)), |
145 index_(index), | 145 index_(index), |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 bool result = DictionarySyncIntegrationTestHelper::ApplyChange( | 198 bool result = DictionarySyncIntegrationTestHelper::ApplyChange( |
199 GetDictionary(index), dictionary_change); | 199 GetDictionary(index), dictionary_change); |
200 if (sync_datatype_helper::test()->use_verifier()) { | 200 if (sync_datatype_helper::test()->use_verifier()) { |
201 result &= DictionarySyncIntegrationTestHelper::ApplyChange( | 201 result &= DictionarySyncIntegrationTestHelper::ApplyChange( |
202 GetVerifierDictionary(), dictionary_change); | 202 GetVerifierDictionary(), dictionary_change); |
203 } | 203 } |
204 return result; | 204 return result; |
205 } | 205 } |
206 | 206 |
207 } // namespace dictionary_helper | 207 } // namespace dictionary_helper |
OLD | NEW |