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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "base/test/histogram_tester.h" | 13 #include "base/test/histogram_tester.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 15 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/signin/account_tracker_service_factory.h" |
17 #include "chrome/browser/ui/autofill/account_chooser_model.h" | 18 #include "chrome/browser/ui/autofill/account_chooser_model.h" |
18 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 19 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
19 #include "chrome/browser/ui/autofill/autofill_dialog_i18n_input.h" | 20 #include "chrome/browser/ui/autofill/autofill_dialog_i18n_input.h" |
20 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 21 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
21 #include "chrome/browser/ui/autofill/autofill_dialog_view_tester.h" | 22 #include "chrome/browser/ui/autofill/autofill_dialog_view_tester.h" |
22 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 23 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
23 #include "chrome/browser/ui/autofill/data_model_wrapper.h" | 24 #include "chrome/browser/ui/autofill/data_model_wrapper.h" |
24 #include "chrome/browser/ui/autofill/mock_address_validator.h" | 25 #include "chrome/browser/ui/autofill/mock_address_validator.h" |
25 #include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_controlle
r.h" | 26 #include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_controlle
r.h" |
26 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
27 #include "chrome/browser/ui/browser_tabstrip.h" | 28 #include "chrome/browser/ui/browser_tabstrip.h" |
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
29 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
31 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
32 #include "chrome/test/base/in_process_browser_test.h" | 33 #include "chrome/test/base/in_process_browser_test.h" |
33 #include "chrome/test/base/ui_test_utils.h" | 34 #include "chrome/test/base/ui_test_utils.h" |
34 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" | 35 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" |
35 #include "components/autofill/content/browser/wallet/gaia_account.h" | 36 #include "components/autofill/content/browser/wallet/gaia_account.h" |
36 #include "components/autofill/content/browser/wallet/mock_wallet_client.h" | 37 #include "components/autofill/content/browser/wallet/mock_wallet_client.h" |
37 #include "components/autofill/content/browser/wallet/wallet_service_url.h" | 38 #include "components/autofill/content/browser/wallet/wallet_service_url.h" |
38 #include "components/autofill/content/browser/wallet/wallet_test_util.h" | 39 #include "components/autofill/content/browser/wallet/wallet_test_util.h" |
39 #include "components/autofill/core/browser/autofill_metrics.h" | 40 #include "components/autofill/core/browser/autofill_metrics.h" |
40 #include "components/autofill/core/browser/autofill_test_utils.h" | 41 #include "components/autofill/core/browser/autofill_test_utils.h" |
41 #include "components/autofill/core/browser/test_personal_data_manager.h" | 42 #include "components/autofill/core/browser/test_personal_data_manager.h" |
42 #include "components/autofill/core/browser/validation.h" | 43 #include "components/autofill/core/browser/validation.h" |
43 #include "components/autofill/core/common/autofill_switches.h" | 44 #include "components/autofill/core/common/autofill_switches.h" |
44 #include "components/autofill/core/common/form_data.h" | 45 #include "components/autofill/core/common/form_data.h" |
45 #include "components/autofill/core/common/form_field_data.h" | 46 #include "components/autofill/core/common/form_field_data.h" |
| 47 #include "components/signin/core/browser/account_tracker_service.h" |
46 #include "content/public/browser/browser_thread.h" | 48 #include "content/public/browser/browser_thread.h" |
47 #include "content/public/browser/interstitial_page.h" | 49 #include "content/public/browser/interstitial_page.h" |
48 #include "content/public/browser/navigation_details.h" | 50 #include "content/public/browser/navigation_details.h" |
49 #include "content/public/browser/navigation_entry.h" | 51 #include "content/public/browser/navigation_entry.h" |
50 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
51 #include "content/public/browser/notification_types.h" | 53 #include "content/public/browser/notification_types.h" |
52 #include "content/public/browser/page_navigator.h" | 54 #include "content/public/browser/page_navigator.h" |
53 #include "content/public/browser/web_contents.h" | 55 #include "content/public/browser/web_contents.h" |
54 #include "content/public/browser/web_contents_delegate.h" | 56 #include "content/public/browser/web_contents_delegate.h" |
55 #include "content/public/common/content_switches.h" | 57 #include "content/public/common/content_switches.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 form_data, | 99 form_data, |
98 form_data.origin, | 100 form_data.origin, |
99 base::Bind(&MockCallback)), | 101 base::Bind(&MockCallback)), |
100 mock_wallet_client_( | 102 mock_wallet_client_( |
101 Profile::FromBrowserContext(contents->GetBrowserContext())-> | 103 Profile::FromBrowserContext(contents->GetBrowserContext())-> |
102 GetRequestContext(), this, form_data.origin), | 104 GetRequestContext(), this, form_data.origin), |
103 message_loop_runner_(runner), | 105 message_loop_runner_(runner), |
104 use_validation_(false), | 106 use_validation_(false), |
105 sign_in_user_index_(0U), | 107 sign_in_user_index_(0U), |
106 weak_ptr_factory_(this) { | 108 weak_ptr_factory_(this) { |
| 109 Profile* profile = |
| 110 Profile::FromBrowserContext(contents->GetBrowserContext()); |
107 test_manager_.Init( | 111 test_manager_.Init( |
108 NULL, | 112 NULL, |
109 Profile::FromBrowserContext(contents->GetBrowserContext())->GetPrefs(), | 113 profile->GetPrefs(), |
| 114 AccountTrackerServiceFactory::GetForProfile(profile), |
110 false); | 115 false); |
111 } | 116 } |
112 | 117 |
113 virtual ~TestAutofillDialogController() {} | 118 virtual ~TestAutofillDialogController() {} |
114 | 119 |
115 GURL FakeSignInUrl() const { | 120 GURL FakeSignInUrl() const { |
116 return GURL(chrome::kChromeUIVersionURL); | 121 return GURL(chrome::kChromeUIVersionURL); |
117 } | 122 } |
118 | 123 |
119 virtual void ShowSignIn(const GURL& url) override { | 124 virtual void ShowSignIn(const GURL& url) override { |
(...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 ASSERT_TRUE(content::ExecuteScriptAndExtractString(GetRenderViewHost(), | 1855 ASSERT_TRUE(content::ExecuteScriptAndExtractString(GetRenderViewHost(), |
1851 "navigateFrame();", | 1856 "navigateFrame();", |
1852 &unused)); | 1857 &unused)); |
1853 ExpectDomMessage("iframe loaded"); | 1858 ExpectDomMessage("iframe loaded"); |
1854 ChromeAutofillClient* client = | 1859 ChromeAutofillClient* client = |
1855 ChromeAutofillClient::FromWebContents(GetActiveWebContents()); | 1860 ChromeAutofillClient::FromWebContents(GetActiveWebContents()); |
1856 EXPECT_FALSE(client->GetDialogControllerForTesting()); | 1861 EXPECT_FALSE(client->GetDialogControllerForTesting()); |
1857 } | 1862 } |
1858 | 1863 |
1859 } // namespace autofill | 1864 } // namespace autofill |
OLD | NEW |