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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 submit_button_delay_count_(0) {} | 252 submit_button_delay_count_(0) {} |
252 | 253 |
253 virtual ~TestAutofillDialogController() {} | 254 virtual ~TestAutofillDialogController() {} |
254 | 255 |
255 virtual AutofillDialogView* CreateView() OVERRIDE { | 256 virtual AutofillDialogView* CreateView() OVERRIDE { |
256 return new testing::NiceMock<TestAutofillDialogView>(); | 257 return new testing::NiceMock<TestAutofillDialogView>(); |
257 } | 258 } |
258 | 259 |
259 void Init(content::BrowserContext* browser_context) { | 260 void Init(content::BrowserContext* browser_context) { |
260 test_manager_.Init( | 261 test_manager_.Init( |
261 AutofillWebDataService::FromBrowserContext(browser_context), | 262 WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 263 Profile::FromBrowserContext(browser_context), |
| 264 Profile::EXPLICIT_ACCESS), |
262 user_prefs::UserPrefs::Get(browser_context), | 265 user_prefs::UserPrefs::Get(browser_context), |
263 browser_context->IsOffTheRecord()); | 266 browser_context->IsOffTheRecord()); |
264 } | 267 } |
265 | 268 |
266 TestAutofillDialogView* GetView() { | 269 TestAutofillDialogView* GetView() { |
267 return static_cast<TestAutofillDialogView*>(view()); | 270 return static_cast<TestAutofillDialogView*>(view()); |
268 } | 271 } |
269 | 272 |
270 TestPersonalDataManager* GetTestingManager() { | 273 TestPersonalDataManager* GetTestingManager() { |
271 return &test_manager_; | 274 return &test_manager_; |
(...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2691 EXPECT_NE(TestAutofillDialogController::NOT_CHECKED, | 2694 EXPECT_NE(TestAutofillDialogController::NOT_CHECKED, |
2692 controller()->SignedInState()); | 2695 controller()->SignedInState()); |
2693 controller()->OnDidFetchWalletCookieValue(std::string()); | 2696 controller()->OnDidFetchWalletCookieValue(std::string()); |
2694 controller()->OnDidGetWalletItems(CompleteAndValidWalletItems()); | 2697 controller()->OnDidGetWalletItems(CompleteAndValidWalletItems()); |
2695 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( | 2698 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( |
2696 GoogleServiceAuthError::CONNECTION_FAILED)); | 2699 GoogleServiceAuthError::CONNECTION_FAILED)); |
2697 EXPECT_NE(use_wallet_text, controller()->SignInLinkText()); | 2700 EXPECT_NE(use_wallet_text, controller()->SignInLinkText()); |
2698 } | 2701 } |
2699 | 2702 |
2700 } // namespace autofill | 2703 } // namespace autofill |
OLD | NEW |