| 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/guid.h" | 5 #include "base/guid.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 10 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
| 11 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" | 11 #include "chrome/browser/ui/autofill/autofill_dialog_view.h" |
| 12 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 13 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 14 #include "components/autofill/browser/autofill_common_test.h" | 15 #include "components/autofill/browser/autofill_common_test.h" |
| 15 #include "components/autofill/browser/autofill_metrics.h" | 16 #include "components/autofill/browser/autofill_metrics.h" |
| 16 #include "components/autofill/browser/wallet/full_wallet.h" | 17 #include "components/autofill/browser/wallet/full_wallet.h" |
| 17 #include "components/autofill/browser/wallet/instrument.h" | 18 #include "components/autofill/browser/wallet/instrument.h" |
| 18 #include "components/autofill/browser/wallet/wallet_address.h" | 19 #include "components/autofill/browser/wallet/wallet_address.h" |
| 19 #include "components/autofill/browser/wallet/wallet_client.h" | 20 #include "components/autofill/browser/wallet/wallet_client.h" |
| 20 #include "components/autofill/browser/wallet/wallet_test_util.h" | 21 #include "components/autofill/browser/wallet/wallet_test_util.h" |
| 22 #include "components/autofill/browser/webdata/autofill_webdata_service.h" |
| 21 #include "components/autofill/common/form_data.h" | 23 #include "components/autofill/common/form_data.h" |
| 22 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 23 #include "content/public/test/test_browser_thread.h" | 25 #include "content/public/test/test_browser_thread.h" |
| 24 #include "content/public/test/web_contents_tester.h" | 26 #include "content/public/test/web_contents_tester.h" |
| 25 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 27 | 29 |
| 28 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
| 29 #include "ui/base/win/scoped_ole_initializer.h" | 31 #include "ui/base/win/scoped_ole_initializer.h" |
| 30 #endif | 32 #endif |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 Profile::FromBrowserContext(contents->GetBrowserContext())-> | 181 Profile::FromBrowserContext(contents->GetBrowserContext())-> |
| 180 GetRequestContext(), this)), | 182 GetRequestContext(), this)), |
| 181 is_first_run_(true) {} | 183 is_first_run_(true) {} |
| 182 virtual ~TestAutofillDialogController() {} | 184 virtual ~TestAutofillDialogController() {} |
| 183 | 185 |
| 184 virtual AutofillDialogView* CreateView() OVERRIDE { | 186 virtual AutofillDialogView* CreateView() OVERRIDE { |
| 185 return new testing::NiceMock<TestAutofillDialogView>(); | 187 return new testing::NiceMock<TestAutofillDialogView>(); |
| 186 } | 188 } |
| 187 | 189 |
| 188 void Init(content::BrowserContext* browser_context) { | 190 void Init(content::BrowserContext* browser_context) { |
| 189 test_manager_.Init(browser_context); | 191 test_manager_.Init( |
| 192 browser_context, |
| 193 WebDataServiceFactory::GetAutofillWebDataServiceForProfile( |
| 194 Profile::FromBrowserContext(browser_context))); |
| 190 } | 195 } |
| 191 | 196 |
| 192 TestAutofillDialogView* GetView() { | 197 TestAutofillDialogView* GetView() { |
| 193 return static_cast<TestAutofillDialogView*>(view()); | 198 return static_cast<TestAutofillDialogView*>(view()); |
| 194 } | 199 } |
| 195 | 200 |
| 196 TestPersonalDataManager* GetTestingManager() { | 201 TestPersonalDataManager* GetTestingManager() { |
| 197 return &test_manager_; | 202 return &test_manager_; |
| 198 } | 203 } |
| 199 | 204 |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 wallet_items->AddAddress(wallet::GetTestShippingAddress()); | 815 wallet_items->AddAddress(wallet::GetTestShippingAddress()); |
| 811 controller()->OnDidGetWalletItems(wallet_items.Pass()); | 816 controller()->OnDidGetWalletItems(wallet_items.Pass()); |
| 812 | 817 |
| 813 EXPECT_TRUE(NotificationsOfType( | 818 EXPECT_TRUE(NotificationsOfType( |
| 814 DialogNotification::EXPLANATORY_MESSAGE).empty()); | 819 DialogNotification::EXPLANATORY_MESSAGE).empty()); |
| 815 EXPECT_TRUE(NotificationsOfType( | 820 EXPECT_TRUE(NotificationsOfType( |
| 816 DialogNotification::WALLET_USAGE_CONFIRMATION).empty()); | 821 DialogNotification::WALLET_USAGE_CONFIRMATION).empty()); |
| 817 } | 822 } |
| 818 | 823 |
| 819 } // namespace autofill | 824 } // namespace autofill |
| OLD | NEW |