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/preferences_helper.h" | 5 #include "chrome/browser/sync/test/integration/preferences_helper.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/sync/test/integration/multi_client_status_change_checke
r.h" | 9 #include "chrome/browser/sync/test/integration/multi_client_status_change_checke
r.h" |
10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 10 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 259 } |
260 | 260 |
261 StartBlockingWait(); | 261 StartBlockingWait(); |
262 } | 262 } |
263 | 263 |
264 const char* PrefMatchChecker::GetPath() const { | 264 const char* PrefMatchChecker::GetPath() const { |
265 return path_; | 265 return path_; |
266 } | 266 } |
267 | 267 |
268 void PrefMatchChecker::RegisterPrefListener(PrefService* pref_service) { | 268 void PrefMatchChecker::RegisterPrefListener(PrefService* pref_service) { |
269 scoped_ptr<PrefChangeRegistrar> registrar(new PrefChangeRegistrar()); | 269 std::unique_ptr<PrefChangeRegistrar> registrar(new PrefChangeRegistrar()); |
270 registrar->Init(pref_service); | 270 registrar->Init(pref_service); |
271 registrar->Add(path_, | 271 registrar->Add(path_, |
272 base::Bind(&PrefMatchChecker::CheckExitCondition, | 272 base::Bind(&PrefMatchChecker::CheckExitCondition, |
273 base::Unretained(this))); | 273 base::Unretained(this))); |
274 pref_change_registrars_.push_back(registrar.release()); | 274 pref_change_registrars_.push_back(registrar.release()); |
275 } | 275 } |
276 | 276 |
277 // Helper class used in the implementation of AwaitListPrefMatches. | 277 // Helper class used in the implementation of AwaitListPrefMatches. |
278 class ListPrefMatchChecker : public PrefMatchChecker { | 278 class ListPrefMatchChecker : public PrefMatchChecker { |
279 public: | 279 public: |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 return !checker.TimedOut(); | 378 return !checker.TimedOut(); |
379 } | 379 } |
380 | 380 |
381 bool AwaitStringPrefMatches(const char* pref_name) { | 381 bool AwaitStringPrefMatches(const char* pref_name) { |
382 StringPrefMatchChecker checker(pref_name); | 382 StringPrefMatchChecker checker(pref_name); |
383 checker.Wait(); | 383 checker.Wait(); |
384 return !checker.TimedOut(); | 384 return !checker.TimedOut(); |
385 } | 385 } |
386 | 386 |
387 } // namespace preferences_helper | 387 } // namespace preferences_helper |
OLD | NEW |