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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/tuple.h" | 17 #include "base/tuple.h" |
18 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 18 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
19 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 19 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
20 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" | 20 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" |
21 #include "chrome/browser/ui/autofill/mock_new_credit_card_bubble_controller.h" | 21 #include "chrome/browser/ui/autofill/mock_new_credit_card_bubble_controller.h" |
22 #include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_controlle
r.h" | 22 #include "chrome/browser/ui/autofill/test_generated_credit_card_bubble_controlle
r.h" |
| 23 #include "chrome/browser/webdata/web_data_service_factory.h" |
23 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
24 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
25 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 26 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
26 #include "chrome/test/base/scoped_testing_local_state.h" | 27 #include "chrome/test/base/scoped_testing_local_state.h" |
27 #include "chrome/test/base/testing_browser_process.h" | 28 #include "chrome/test/base/testing_browser_process.h" |
28 #include "chrome/test/base/testing_profile.h" | 29 #include "chrome/test/base/testing_profile.h" |
29 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" | 30 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" |
30 #include "components/autofill/content/browser/wallet/full_wallet.h" | 31 #include "components/autofill/content/browser/wallet/full_wallet.h" |
31 #include "components/autofill/content/browser/wallet/instrument.h" | 32 #include "components/autofill/content/browser/wallet/instrument.h" |
32 #include "components/autofill/content/browser/wallet/mock_wallet_client.h" | 33 #include "components/autofill/content/browser/wallet/mock_wallet_client.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 submit_button_delay_count_(0) {} | 251 submit_button_delay_count_(0) {} |
251 | 252 |
252 virtual ~TestAutofillDialogController() {} | 253 virtual ~TestAutofillDialogController() {} |
253 | 254 |
254 virtual AutofillDialogView* CreateView() OVERRIDE { | 255 virtual AutofillDialogView* CreateView() OVERRIDE { |
255 return new testing::NiceMock<TestAutofillDialogView>(); | 256 return new testing::NiceMock<TestAutofillDialogView>(); |
256 } | 257 } |
257 | 258 |
258 void Init(content::BrowserContext* browser_context) { | 259 void Init(content::BrowserContext* browser_context) { |
259 test_manager_.Init( | 260 test_manager_.Init( |
260 AutofillWebDataService::FromBrowserContext(browser_context), | 261 WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 262 Profile::FromBrowserContext(browser_context), |
| 263 Profile::EXPLICIT_ACCESS), |
261 user_prefs::UserPrefs::Get(browser_context), | 264 user_prefs::UserPrefs::Get(browser_context), |
262 browser_context->IsOffTheRecord()); | 265 browser_context->IsOffTheRecord()); |
263 } | 266 } |
264 | 267 |
265 TestAutofillDialogView* GetView() { | 268 TestAutofillDialogView* GetView() { |
266 return static_cast<TestAutofillDialogView*>(view()); | 269 return static_cast<TestAutofillDialogView*>(view()); |
267 } | 270 } |
268 | 271 |
269 TestPersonalDataManager* GetTestingManager() { | 272 TestPersonalDataManager* GetTestingManager() { |
270 return &test_manager_; | 273 return &test_manager_; |
(...skipping 2427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2698 controller()->OnDidGetWalletItems( | 2701 controller()->OnDidGetWalletItems( |
2699 wallet::GetTestWalletItemsWithRequiredAction( | 2702 wallet::GetTestWalletItemsWithRequiredAction( |
2700 wallet::PASSIVE_GAIA_AUTH)); | 2703 wallet::PASSIVE_GAIA_AUTH)); |
2701 EXPECT_TRUE(controller()->ShouldShowSpinner()); | 2704 EXPECT_TRUE(controller()->ShouldShowSpinner()); |
2702 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( | 2705 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( |
2703 GoogleServiceAuthError::NONE)); | 2706 GoogleServiceAuthError::NONE)); |
2704 EXPECT_FALSE(controller()->ShouldShowSpinner()); | 2707 EXPECT_FALSE(controller()->ShouldShowSpinner()); |
2705 } | 2708 } |
2706 | 2709 |
2707 } // namespace autofill | 2710 } // namespace autofill |
OLD | NEW |