OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/macros.h" | 5 #include "base/macros.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_tabstrip.h" | 9 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
12 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
13 #include "components/autofill/content/browser/content_autofill_driver.h" | 13 #include "components/autofill/content/browser/content_autofill_driver.h" |
14 #include "components/autofill/content/browser/content_autofill_driver_factory.h" | 14 #include "components/autofill/content/browser/content_autofill_driver_factory.h" |
15 #include "components/autofill/core/browser/autofill_manager.h" | 15 #include "components/autofill/core/browser/autofill_manager.h" |
16 #include "components/autofill/core/browser/test_autofill_client.h" | 16 #include "components/autofill/core/browser/test_autofill_client.h" |
17 #include "components/syncable_prefs/testing_pref_service_syncable.h" | 17 #include "components/sync_preferences/testing_pref_service_syncable.h" |
18 #include "content/public/browser/navigation_controller.h" | 18 #include "content/public/browser/navigation_controller.h" |
19 #include "content/public/browser/page_navigator.h" | 19 #include "content/public/browser/page_navigator.h" |
20 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
21 #include "content/public/browser/web_contents_observer.h" | 21 #include "content/public/browser/web_contents_observer.h" |
22 #include "content/public/common/url_constants.h" | 22 #include "content/public/common/url_constants.h" |
23 #include "content/public/test/test_utils.h" | 23 #include "content/public/test/test_utils.h" |
24 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 #include "ui/gfx/geometry/rect.h" | 26 #include "ui/gfx/geometry/rect.h" |
27 | 27 |
(...skipping 13 matching lines...) Expand all Loading... |
41 | 41 |
42 MOCK_METHOD4(ShowAutofillPopup, | 42 MOCK_METHOD4(ShowAutofillPopup, |
43 void(const gfx::RectF& element_bounds, | 43 void(const gfx::RectF& element_bounds, |
44 base::i18n::TextDirection text_direction, | 44 base::i18n::TextDirection text_direction, |
45 const std::vector<autofill::Suggestion>& suggestions, | 45 const std::vector<autofill::Suggestion>& suggestions, |
46 base::WeakPtr<AutofillPopupDelegate> delegate)); | 46 base::WeakPtr<AutofillPopupDelegate> delegate)); |
47 | 47 |
48 MOCK_METHOD0(HideAutofillPopup, void()); | 48 MOCK_METHOD0(HideAutofillPopup, void()); |
49 | 49 |
50 private: | 50 private: |
51 syncable_prefs::TestingPrefServiceSyncable prefs_; | 51 sync_preferences::TestingPrefServiceSyncable prefs_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(MockAutofillClient); | 53 DISALLOW_COPY_AND_ASSIGN(MockAutofillClient); |
54 }; | 54 }; |
55 | 55 |
56 // Subclass ContentAutofillDriver so we can create an ContentAutofillDriver | 56 // Subclass ContentAutofillDriver so we can create an ContentAutofillDriver |
57 // instance. | 57 // instance. |
58 class TestContentAutofillDriver : public ContentAutofillDriver { | 58 class TestContentAutofillDriver : public ContentAutofillDriver { |
59 public: | 59 public: |
60 TestContentAutofillDriver(content::RenderFrameHost* rfh, | 60 TestContentAutofillDriver(content::RenderFrameHost* rfh, |
61 AutofillClient* client) | 61 AutofillClient* client) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 GURL(chrome::kChromeUIBookmarksURL), content::Referrer(), | 140 GURL(chrome::kChromeUIBookmarksURL), content::Referrer(), |
141 WindowOpenDisposition::CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false)); | 141 WindowOpenDisposition::CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false)); |
142 browser()->OpenURL(content::OpenURLParams( | 142 browser()->OpenURL(content::OpenURLParams( |
143 GURL(chrome::kChromeUIAboutURL), content::Referrer(), | 143 GURL(chrome::kChromeUIAboutURL), content::Referrer(), |
144 WindowOpenDisposition::CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false)); | 144 WindowOpenDisposition::CURRENT_TAB, ui::PAGE_TRANSITION_TYPED, false)); |
145 runner->Run(); | 145 runner->Run(); |
146 nav_entry_committed_callback_.Reset(); | 146 nav_entry_committed_callback_.Reset(); |
147 } | 147 } |
148 | 148 |
149 } // namespace autofill | 149 } // namespace autofill |
OLD | NEW |