| 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" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" | 29 #include "components/autofill/content/browser/risk/proto/fingerprint.pb.h" |
| 30 #include "components/autofill/content/browser/wallet/full_wallet.h" | 30 #include "components/autofill/content/browser/wallet/full_wallet.h" |
| 31 #include "components/autofill/content/browser/wallet/instrument.h" | 31 #include "components/autofill/content/browser/wallet/instrument.h" |
| 32 #include "components/autofill/content/browser/wallet/mock_wallet_client.h" | 32 #include "components/autofill/content/browser/wallet/mock_wallet_client.h" |
| 33 #include "components/autofill/content/browser/wallet/wallet_address.h" | 33 #include "components/autofill/content/browser/wallet/wallet_address.h" |
| 34 #include "components/autofill/content/browser/wallet/wallet_service_url.h" | 34 #include "components/autofill/content/browser/wallet/wallet_service_url.h" |
| 35 #include "components/autofill/content/browser/wallet/wallet_test_util.h" | 35 #include "components/autofill/content/browser/wallet/wallet_test_util.h" |
| 36 #include "components/autofill/core/browser/autofill_metrics.h" | 36 #include "components/autofill/core/browser/autofill_metrics.h" |
| 37 #include "components/autofill/core/browser/autofill_test_utils.h" | 37 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 38 #include "components/autofill/core/browser/test_personal_data_manager.h" | 38 #include "components/autofill/core/browser/test_personal_data_manager.h" |
| 39 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 39 #include "components/autofill/core/common/autofill_switches.h" | 40 #include "components/autofill/core/common/autofill_switches.h" |
| 40 #include "components/autofill/core/common/form_data.h" | 41 #include "components/autofill/core/common/form_data.h" |
| 41 #include "components/user_prefs/user_prefs.h" | 42 #include "components/user_prefs/user_prefs.h" |
| 42 #include "content/public/browser/web_contents.h" | 43 #include "content/public/browser/web_contents.h" |
| 43 #include "content/public/test/mock_render_process_host.h" | 44 #include "content/public/test/mock_render_process_host.h" |
| 44 #include "google_apis/gaia/google_service_auth_error.h" | 45 #include "google_apis/gaia/google_service_auth_error.h" |
| 45 #include "testing/gmock/include/gmock/gmock.h" | 46 #include "testing/gmock/include/gmock/gmock.h" |
| 46 #include "testing/gtest/include/gtest/gtest.h" | 47 #include "testing/gtest/include/gtest/gtest.h" |
| 47 | 48 |
| 48 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 mock_new_card_bubble_controller_(mock_new_card_bubble_controller), | 250 mock_new_card_bubble_controller_(mock_new_card_bubble_controller), |
| 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(browser_context, | 260 test_manager_.Init( |
| 260 user_prefs::UserPrefs::Get(browser_context), | 261 AutofillWebDataService::FromBrowserContext(browser_context), |
| 261 browser_context->IsOffTheRecord()); | 262 user_prefs::UserPrefs::Get(browser_context), |
| 263 browser_context->IsOffTheRecord()); |
| 262 } | 264 } |
| 263 | 265 |
| 264 TestAutofillDialogView* GetView() { | 266 TestAutofillDialogView* GetView() { |
| 265 return static_cast<TestAutofillDialogView*>(view()); | 267 return static_cast<TestAutofillDialogView*>(view()); |
| 266 } | 268 } |
| 267 | 269 |
| 268 TestPersonalDataManager* GetTestingManager() { | 270 TestPersonalDataManager* GetTestingManager() { |
| 269 return &test_manager_; | 271 return &test_manager_; |
| 270 } | 272 } |
| 271 | 273 |
| (...skipping 2419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2691 controller()->SignedInState()); | 2693 controller()->SignedInState()); |
| 2692 controller()->OnDidFetchWalletCookieValue(std::string()); | 2694 controller()->OnDidFetchWalletCookieValue(std::string()); |
| 2693 controller()->OnDidGetWalletItems(CompleteAndValidWalletItems()); | 2695 controller()->OnDidGetWalletItems(CompleteAndValidWalletItems()); |
| 2694 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( | 2696 controller()->OnPassiveSigninFailure(GoogleServiceAuthError( |
| 2695 GoogleServiceAuthError::CONNECTION_FAILED)); | 2697 GoogleServiceAuthError::CONNECTION_FAILED)); |
| 2696 EXPECT_FALSE(controller()->ShouldDisableSignInLink()); | 2698 EXPECT_FALSE(controller()->ShouldDisableSignInLink()); |
| 2697 EXPECT_NE(use_wallet_text, controller()->SignInLinkText()); | 2699 EXPECT_NE(use_wallet_text, controller()->SignInLinkText()); |
| 2698 } | 2700 } |
| 2699 | 2701 |
| 2700 } // namespace autofill | 2702 } // namespace autofill |
| OLD | NEW |