Chromium Code Reviews| Index: components/autofill/core/browser/autofill_manager_unittest.cc |
| diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc |
| index 8ffc6054ded84219a80750f3973beec78254b131..2560369d123f7d635ccf748150239194580058ca 100644 |
| --- a/components/autofill/core/browser/autofill_manager_unittest.cc |
| +++ b/components/autofill/core/browser/autofill_manager_unittest.cc |
| @@ -35,6 +35,7 @@ |
| #include "components/autofill/core/browser/test_autofill_driver.h" |
| #include "components/autofill/core/browser/test_autofill_external_delegate.h" |
| #include "components/autofill/core/browser/test_autofill_manager_delegate.h" |
| +#include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| #include "components/autofill/core/common/autofill_messages.h" |
| #include "components/autofill/core/common/autofill_pref_names.h" |
| #include "components/autofill/core/common/form_data.h" |
| @@ -75,8 +76,9 @@ class TestPersonalDataManager : public PersonalDataManager { |
| CreateTestCreditCards(&credit_cards_); |
| } |
| - void SetBrowserContext(content::BrowserContext* context) { |
| - set_browser_context(context); |
| + void SetAutofillWebDataService( |
| + scoped_refptr<AutofillWebDataService> webdata) { |
| + set_autofill_webdata_service(webdata); |
| } |
|
Ilya Sherman
2013/11/14 02:22:02
nit: Why not just "using PersonalDataManager::set_
blundell
2013/11/14 16:46:30
Done.
|
| void SetPrefService(PrefService* pref_service) { |
| @@ -640,13 +642,14 @@ class AutofillManagerTest : public ChromeRenderViewHostTestHarness { |
| autofill::TabAutofillManagerDelegate::CreateForWebContents(web_contents()); |
| - personal_data_.SetBrowserContext(profile()); |
| + autofill::TabAutofillManagerDelegate* manager_delegate = |
| + autofill::TabAutofillManagerDelegate::FromWebContents(web_contents()); |
| + personal_data_.SetAutofillWebDataService( |
| + manager_delegate->GetAutofillWebDataService()); |
| personal_data_.SetPrefService(profile()->GetPrefs()); |
| autofill_driver_.reset(new MockAutofillDriver(web_contents())); |
| autofill_manager_.reset(new TestAutofillManager( |
| - autofill_driver_.get(), |
| - autofill::TabAutofillManagerDelegate::FromWebContents(web_contents()), |
| - &personal_data_)); |
| + autofill_driver_.get(), manager_delegate, &personal_data_)); |
| external_delegate_.reset(new TestAutofillExternalDelegate( |
| web_contents(), |
| @@ -664,9 +667,10 @@ class AutofillManagerTest : public ChromeRenderViewHostTestHarness { |
| autofill_driver_.reset(); |
| ChromeRenderViewHostTestHarness::TearDown(); |
| - // Remove the BrowserContext so TestPersonalDataManager does not need to |
| - // care about removing self as an observer in destruction. |
| - personal_data_.SetBrowserContext(NULL); |
| + // Remove the AutofillWebDataService so TestPersonalDataManager does not |
| + // need to care about removing self as an observer in destruction. |
| + personal_data_.SetAutofillWebDataService( |
| + scoped_refptr<AutofillWebDataService>(NULL)); |
| } |
| void GetAutofillSuggestions(int query_id, |