Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/browser/sync/test/integration/autofill_helper.cc

Issue 10855253: Convert the autofill pyauto tests to browser tests, and remove all the supporting automation hooks … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/autofill_common_test.h" 7 #include "chrome/browser/autofill/autofill_common_test.h"
8 #include "chrome/browser/autofill/autofill_profile.h" 8 #include "chrome/browser/autofill/autofill_profile.h"
9 #include "chrome/browser/autofill/autofill_type.h" 9 #include "chrome/browser/autofill/autofill_type.h"
10 #include "chrome/browser/autofill/personal_data_manager.h" 10 #include "chrome/browser/autofill/personal_data_manager.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 MockPersonalDataManagerObserver observer; 214 MockPersonalDataManagerObserver observer;
215 EXPECT_CALL(observer, OnPersonalDataChanged()). 215 EXPECT_CALL(observer, OnPersonalDataChanged()).
216 WillOnce(QuitUIMessageLoop()); 216 WillOnce(QuitUIMessageLoop());
217 PersonalDataManager* pdm = GetPersonalDataManager(profile); 217 PersonalDataManager* pdm = GetPersonalDataManager(profile);
218 pdm->SetObserver(&observer); 218 pdm->SetObserver(&observer);
219 pdm->SetProfiles(autofill_profiles); 219 pdm->SetProfiles(autofill_profiles);
220 MessageLoop::current()->Run(); 220 MessageLoop::current()->Run();
221 pdm->RemoveObserver(&observer); 221 pdm->RemoveObserver(&observer);
222 } 222 }
223 223
224 void SetCreditCards(int profile, std::vector<CreditCard>* credit_cards) {
225 MockPersonalDataManagerObserver observer;
226 EXPECT_CALL(observer, OnPersonalDataChanged()).
227 WillOnce(QuitUIMessageLoop());
228 PersonalDataManager* pdm = GetPersonalDataManager(profile);
229 pdm->SetObserver(&observer);
230 pdm->SetCreditCards(credit_cards);
231 MessageLoop::current()->Run();
232 pdm->RemoveObserver(&observer);
233 }
234
224 void AddProfile(int profile, const AutofillProfile& autofill_profile) { 235 void AddProfile(int profile, const AutofillProfile& autofill_profile) {
225 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile); 236 const std::vector<AutofillProfile*>& all_profiles = GetAllProfiles(profile);
226 std::vector<AutofillProfile> autofill_profiles; 237 std::vector<AutofillProfile> autofill_profiles;
227 for (size_t i = 0; i < all_profiles.size(); ++i) 238 for (size_t i = 0; i < all_profiles.size(); ++i)
228 autofill_profiles.push_back(*all_profiles[i]); 239 autofill_profiles.push_back(*all_profiles[i]);
229 autofill_profiles.push_back(autofill_profile); 240 autofill_profiles.push_back(autofill_profile);
230 autofill_helper::SetProfiles(profile, &autofill_profiles); 241 autofill_helper::SetProfiles(profile, &autofill_profiles);
231 } 242 }
232 243
233 void RemoveProfile(int profile, const std::string& guid) { 244 void RemoveProfile(int profile, const std::string& guid) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 if (!ProfilesMatch(0, i)) { 326 if (!ProfilesMatch(0, i)) {
316 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " 327 LOG(ERROR) << "Profile " << i << "does not contain the same autofill "
317 "profiles as profile 0."; 328 "profiles as profile 0.";
318 return false; 329 return false;
319 } 330 }
320 } 331 }
321 return true; 332 return true;
322 } 333 }
323 334
324 } // namespace autofill_helper 335 } // namespace autofill_helper
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698