| 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 "chrome/browser/autofill/autofill_popup_view.h" | 5 #include "chrome/browser/autofill/autofill_popup_view.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/test/base/ui_test_utils.h" | 9 #include "chrome/test/base/ui_test_utils.h" |
| 10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
| 11 #include "content/public/browser/notification_service.h" | 11 #include "content/public/browser/notification_service.h" |
| 12 #include "content/public/browser/notification_types.h" | 12 #include "content/public/browser/notification_types.h" |
| 13 #include "content/public/browser/page_navigator.h" | 13 #include "content/public/browser/page_navigator.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "content/public/common/url_constants.h" | 15 #include "content/public/common/url_constants.h" |
| 16 #include "content/test/browser_test.h" | 16 #include "content/test/browser_test.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 | 19 |
| 20 using ::testing::AtLeast; | 20 using ::testing::AtLeast; |
| 21 | 21 |
| 22 class TestAutofillPopupView : public AutofillPopupView { | 22 class TestAutofillPopupView : public AutofillPopupView { |
| 23 public: | 23 public: |
| 24 explicit TestAutofillPopupView(content::WebContents* web_contents) | 24 explicit TestAutofillPopupView(content::WebContents* web_contents) |
| 25 : AutofillPopupView(web_contents) {} | 25 : AutofillPopupView(web_contents) {} |
| 26 virtual ~TestAutofillPopupView() {} | 26 virtual ~TestAutofillPopupView() {} |
| 27 | 27 |
| 28 MOCK_METHOD0(Hide, void()); | 28 MOCK_METHOD0(Hide, void()); |
| 29 | 29 |
| 30 virtual void Show(const std::vector<string16>& autofill_values, | 30 virtual void ShowInternal() OVERRIDE {} |
| 31 const std::vector<string16>& autofill_labels, | |
| 32 const std::vector<string16>& autofill_icons, | |
| 33 const std::vector<int>& autofill_unique_ids, | |
| 34 int separator_index) OVERRIDE {} | |
| 35 }; | 31 }; |
| 36 | 32 |
| 37 class AutofillPopupViewBrowserTest : public InProcessBrowserTest { | 33 class AutofillPopupViewBrowserTest : public InProcessBrowserTest { |
| 38 public: | 34 public: |
| 39 AutofillPopupViewBrowserTest() {} | 35 AutofillPopupViewBrowserTest() {} |
| 40 virtual ~AutofillPopupViewBrowserTest() {} | 36 virtual ~AutofillPopupViewBrowserTest() {} |
| 41 | 37 |
| 42 protected: | 38 protected: |
| 43 scoped_ptr<TestAutofillPopupView> autofill_popup_view_; | 39 scoped_ptr<TestAutofillPopupView> autofill_popup_view_; |
| 44 }; | 40 }; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 74 browser()->OpenURL(content::OpenURLParams( | 70 browser()->OpenURL(content::OpenURLParams( |
| 75 GURL(chrome::kAboutBlankURL), content::Referrer(), | 71 GURL(chrome::kAboutBlankURL), content::Referrer(), |
| 76 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); | 72 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
| 77 browser()->OpenURL(content::OpenURLParams( | 73 browser()->OpenURL(content::OpenURLParams( |
| 78 GURL(chrome::kAboutCrashURL), content::Referrer(), | 74 GURL(chrome::kAboutCrashURL), content::Referrer(), |
| 79 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); | 75 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
| 80 observer.Wait(); | 76 observer.Wait(); |
| 81 | 77 |
| 82 // The mock verifies that the call was made. | 78 // The mock verifies that the call was made. |
| 83 } | 79 } |
| OLD | NEW |