| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 GetAllAutoFillProfiles(profile); | 306 GetAllAutoFillProfiles(profile); |
| 307 std::vector<AutofillProfile> profiles; | 307 std::vector<AutofillProfile> profiles; |
| 308 for (size_t i = 0; i < all_profiles.size(); ++i) { | 308 for (size_t i = 0; i < all_profiles.size(); ++i) { |
| 309 profiles.push_back(*all_profiles[i]); | 309 profiles.push_back(*all_profiles[i]); |
| 310 if (all_profiles[i]->guid() == guid) | 310 if (all_profiles[i]->guid() == guid) |
| 311 profiles.back().SetRawInfo(type.GetStorableType(), value); | 311 profiles.back().SetRawInfo(type.GetStorableType(), value); |
| 312 } | 312 } |
| 313 autofill_helper::SetProfiles(profile, &profiles); | 313 autofill_helper::SetProfiles(profile, &profiles); |
| 314 } | 314 } |
| 315 | 315 |
| 316 const std::vector<AutofillProfile*>& GetAllAutoFillProfiles( | 316 std::vector<AutofillProfile*> GetAllAutoFillProfiles(int profile) { |
| 317 int profile) { | |
| 318 MockPersonalDataManagerObserver observer; | 317 MockPersonalDataManagerObserver observer; |
| 319 EXPECT_CALL(observer, OnPersonalDataChanged()). | 318 EXPECT_CALL(observer, OnPersonalDataChanged()). |
| 320 WillOnce(QuitUIMessageLoop()); | 319 WillOnce(QuitUIMessageLoop()); |
| 321 PersonalDataManager* pdm = GetPersonalDataManager(profile); | 320 PersonalDataManager* pdm = GetPersonalDataManager(profile); |
| 322 pdm->AddObserver(&observer); | 321 pdm->AddObserver(&observer); |
| 323 pdm->Refresh(); | 322 pdm->Refresh(); |
| 324 base::RunLoop().Run(); | 323 base::RunLoop().Run(); |
| 325 pdm->RemoveObserver(&observer); | 324 pdm->RemoveObserver(&observer); |
| 326 return pdm->web_profiles(); | 325 return pdm->web_profiles(); |
| 327 } | 326 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 profile_b_, autofill_profiles_b); | 434 profile_b_, autofill_profiles_b); |
| 436 } | 435 } |
| 437 | 436 |
| 438 std::string AutofillProfileChecker::GetDebugMessage() const { | 437 std::string AutofillProfileChecker::GetDebugMessage() const { |
| 439 return "Waiting for matching autofill profiles"; | 438 return "Waiting for matching autofill profiles"; |
| 440 } | 439 } |
| 441 | 440 |
| 442 void AutofillProfileChecker::OnPersonalDataChanged() { | 441 void AutofillProfileChecker::OnPersonalDataChanged() { |
| 443 CheckExitCondition(); | 442 CheckExitCondition(); |
| 444 } | 443 } |
| OLD | NEW |