| 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 "chrome/browser/sync/test/integration/autofill_helper.h" | 5 #include "chrome/browser/sync/test/integration/autofill_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 7 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 return GetAllKeys(profile_a) == GetAllKeys(profile_b); | 237 return GetAllKeys(profile_a) == GetAllKeys(profile_b); |
| 238 } | 238 } |
| 239 | 239 |
| 240 namespace { | 240 namespace { |
| 241 | 241 |
| 242 class KeysMatchStatusChecker : public MultiClientStatusChangeChecker { | 242 class KeysMatchStatusChecker : public MultiClientStatusChangeChecker { |
| 243 public: | 243 public: |
| 244 KeysMatchStatusChecker(int profile_a, int profile_b); | 244 KeysMatchStatusChecker(int profile_a, int profile_b); |
| 245 virtual ~KeysMatchStatusChecker(); | 245 virtual ~KeysMatchStatusChecker(); |
| 246 | 246 |
| 247 virtual bool IsExitConditionSatisfied() OVERRIDE; | 247 virtual bool IsExitConditionSatisfied() override; |
| 248 virtual std::string GetDebugMessage() const OVERRIDE; | 248 virtual std::string GetDebugMessage() const override; |
| 249 | 249 |
| 250 private: | 250 private: |
| 251 const int profile_a_; | 251 const int profile_a_; |
| 252 const int profile_b_; | 252 const int profile_b_; |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 KeysMatchStatusChecker::KeysMatchStatusChecker(int profile_a, int profile_b) | 255 KeysMatchStatusChecker::KeysMatchStatusChecker(int profile_a, int profile_b) |
| 256 : MultiClientStatusChangeChecker( | 256 : MultiClientStatusChangeChecker( |
| 257 sync_datatype_helper::test()->GetSyncServices()), | 257 sync_datatype_helper::test()->GetSyncServices()), |
| 258 profile_a_(profile_a), | 258 profile_a_(profile_a), |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 namespace { | 416 namespace { |
| 417 | 417 |
| 418 class ProfilesMatchStatusChecker : public StatusChangeChecker, | 418 class ProfilesMatchStatusChecker : public StatusChangeChecker, |
| 419 public PersonalDataManagerObserver { | 419 public PersonalDataManagerObserver { |
| 420 public: | 420 public: |
| 421 ProfilesMatchStatusChecker(int profile_a, int profile_b); | 421 ProfilesMatchStatusChecker(int profile_a, int profile_b); |
| 422 virtual ~ProfilesMatchStatusChecker(); | 422 virtual ~ProfilesMatchStatusChecker(); |
| 423 | 423 |
| 424 // StatusChangeChecker implementation. | 424 // StatusChangeChecker implementation. |
| 425 virtual bool IsExitConditionSatisfied() OVERRIDE; | 425 virtual bool IsExitConditionSatisfied() override; |
| 426 virtual std::string GetDebugMessage() const OVERRIDE; | 426 virtual std::string GetDebugMessage() const override; |
| 427 | 427 |
| 428 // PersonalDataManager implementation. | 428 // PersonalDataManager implementation. |
| 429 virtual void OnPersonalDataChanged() OVERRIDE; | 429 virtual void OnPersonalDataChanged() override; |
| 430 | 430 |
| 431 // Wait for conidtion to beome true. | 431 // Wait for conidtion to beome true. |
| 432 void Wait(); | 432 void Wait(); |
| 433 | 433 |
| 434 private: | 434 private: |
| 435 const int profile_a_; | 435 const int profile_a_; |
| 436 const int profile_b_; | 436 const int profile_b_; |
| 437 bool registered_; | 437 bool registered_; |
| 438 }; | 438 }; |
| 439 | 439 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 489 |
| 490 } // namespace | 490 } // namespace |
| 491 | 491 |
| 492 bool AwaitProfilesMatch(int a, int b) { | 492 bool AwaitProfilesMatch(int a, int b) { |
| 493 ProfilesMatchStatusChecker checker(a, b); | 493 ProfilesMatchStatusChecker checker(a, b); |
| 494 checker.Wait(); | 494 checker.Wait(); |
| 495 return !checker.TimedOut(); | 495 return !checker.TimedOut(); |
| 496 } | 496 } |
| 497 | 497 |
| 498 } // namespace autofill_helper | 498 } // namespace autofill_helper |
| OLD | NEW |