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/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
14 #include "components/autofill/browser/autofill_common_test.h" | 14 #include "components/autofill/browser/autofill_common_test.h" |
15 #include "components/autofill/browser/autofill_metrics.h" | 15 #include "components/autofill/browser/autofill_metrics.h" |
16 #include "components/autofill/browser/wallet/full_wallet.h" | 16 #include "components/autofill/browser/wallet/full_wallet.h" |
17 #include "components/autofill/browser/wallet/instrument.h" | 17 #include "components/autofill/browser/wallet/instrument.h" |
18 #include "components/autofill/browser/wallet/wallet_address.h" | 18 #include "components/autofill/browser/wallet/wallet_address.h" |
19 #include "components/autofill/browser/wallet/wallet_client.h" | 19 #include "components/autofill/browser/wallet/wallet_client.h" |
20 #include "components/autofill/browser/wallet/wallet_test_util.h" | 20 #include "components/autofill/browser/wallet/wallet_test_util.h" |
21 #include "components/autofill/common/form_data.h" | 21 #include "components/autofill/common/form_data.h" |
22 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
23 #include "content/public/test/test_browser_thread.h" | 23 #include "content/public/test/test_browser_thread.h" |
24 #include "content/public/test/web_contents_tester.h" | 24 #include "content/public/test/web_contents_tester.h" |
25 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
27 | 27 |
| 28 #if defined(OS_WIN) |
| 29 #include "ui/base/win/scoped_ole_initializer.h" |
| 30 #endif |
| 31 |
28 using testing::_; | 32 using testing::_; |
29 | 33 |
30 namespace autofill { | 34 namespace autofill { |
31 | 35 |
32 namespace { | 36 namespace { |
33 | 37 |
34 using content::BrowserThread; | 38 using content::BrowserThread; |
35 | 39 |
36 class TestAutofillDialogView : public AutofillDialogView { | 40 class TestAutofillDialogView : public AutofillDialogView { |
37 public: | 41 public: |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 254 } |
251 | 255 |
252 TestAutofillDialogController* controller() { return controller_; } | 256 TestAutofillDialogController* controller() { return controller_; } |
253 | 257 |
254 TestingProfile* profile() { return &profile_; } | 258 TestingProfile* profile() { return &profile_; } |
255 | 259 |
256 private: | 260 private: |
257 void FinishedCallback(const FormStructure* form_structure, | 261 void FinishedCallback(const FormStructure* form_structure, |
258 const std::string& google_transaction_id) {} | 262 const std::string& google_transaction_id) {} |
259 | 263 |
| 264 #if defined(OS_WIN) |
| 265 // http://crbug.com/227221 |
| 266 ui::ScopedOleInitializer ole_initializer_; |
| 267 #endif |
| 268 |
260 // A bunch of threads are necessary for classes like TestWebContents and | 269 // A bunch of threads are necessary for classes like TestWebContents and |
261 // URLRequestContextGetter not to fall over. | 270 // URLRequestContextGetter not to fall over. |
262 MessageLoopForUI loop_; | 271 MessageLoopForUI loop_; |
263 content::TestBrowserThread ui_thread_; | 272 content::TestBrowserThread ui_thread_; |
264 content::TestBrowserThread file_thread_; | 273 content::TestBrowserThread file_thread_; |
265 content::TestBrowserThread file_blocking_thread_; | 274 content::TestBrowserThread file_blocking_thread_; |
266 content::TestBrowserThread io_thread_; | 275 content::TestBrowserThread io_thread_; |
267 TestingProfile profile_; | 276 TestingProfile profile_; |
268 | 277 |
269 // The controller owns itself. | 278 // The controller owns itself. |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 ASSERT_TRUE(account_menu); | 612 ASSERT_TRUE(account_menu); |
604 ASSERT_GE(2, account_menu->GetItemCount()); | 613 ASSERT_GE(2, account_menu->GetItemCount()); |
605 account_menu->ActivatedAt(0); | 614 account_menu->ActivatedAt(0); |
606 account_menu->ActivatedAt(1); | 615 account_menu->ActivatedAt(1); |
607 | 616 |
608 EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); | 617 EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_OK)); |
609 EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL)); | 618 EXPECT_TRUE(controller()->IsDialogButtonEnabled(ui::DIALOG_BUTTON_CANCEL)); |
610 } | 619 } |
611 | 620 |
612 } // namespace autofill | 621 } // namespace autofill |
OLD | NEW |