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

Side by Side Diff: components/autofill/core/browser/personal_data_manager_unittest.cc

Issue 52713006: Parameterize the PrefService that PersonalDataManager uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review, fix unit tests Created 7 years, 1 month 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
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); 82 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done)));
83 done.Wait(); 83 done.Wait();
84 base::MessageLoop::current()->PostTask(FROM_HERE, 84 base::MessageLoop::current()->PostTask(FROM_HERE,
85 base::MessageLoop::QuitClosure()); 85 base::MessageLoop::QuitClosure());
86 base::MessageLoop::current()->Run(); 86 base::MessageLoop::current()->Run();
87 db_thread_.Stop(); 87 db_thread_.Stop();
88 } 88 }
89 89
90 void ResetPersonalDataManager() { 90 void ResetPersonalDataManager() {
91 personal_data_.reset(new PersonalDataManager("en-US")); 91 personal_data_.reset(new PersonalDataManager("en-US"));
92 personal_data_->Init(profile_.get()); 92 personal_data_->Init(profile_.get(), profile_->GetPrefs());
93 personal_data_->AddObserver(&personal_data_observer_); 93 personal_data_->AddObserver(&personal_data_observer_);
94 94
95 // Verify that the web database has been updated and the notification sent. 95 // Verify that the web database has been updated and the notification sent.
96 EXPECT_CALL(personal_data_observer_, 96 EXPECT_CALL(personal_data_observer_,
97 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); 97 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop());
98 base::MessageLoop::current()->Run(); 98 base::MessageLoop::current()->Run();
99 } 99 }
100 100
101 void MakeProfileIncognito() { 101 void MakeProfileIncognito() {
102 // Switch to an incognito profile. 102 // Switch to an incognito profile.
(...skipping 2381 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 AutofillProfile space_invader(base::GenerateGUID(), "Chrome settings"); 2484 AutofillProfile space_invader(base::GenerateGUID(), "Chrome settings");
2485 test::SetProfileInfo(&space_invader, "Marty", "", "Martian", 2485 test::SetProfileInfo(&space_invader, "Marty", "", "Martian",
2486 "mm@example.com", "", "1 Flying Object", "", "Valles Marineris", "", 2486 "mm@example.com", "", "1 Flying Object", "", "Valles Marineris", "",
2487 "", "XX", ""); 2487 "", "XX", "");
2488 personal_data_->AddProfile(moose); 2488 personal_data_->AddProfile(moose);
2489 ResetPersonalDataManager(); 2489 ResetPersonalDataManager();
2490 EXPECT_EQ("MX", personal_data_->GetDefaultCountryCodeForNewAddress()); 2490 EXPECT_EQ("MX", personal_data_->GetDefaultCountryCodeForNewAddress());
2491 } 2491 }
2492 2492
2493 } // namespace autofill 2493 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/personal_data_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698