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 "chrome/browser/ui/views/autofill/autofill_popup_base_view.h" | 5 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h" |
6 | 6 |
7 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" | 7 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 MOCK_METHOD0(container_view, gfx::NativeView()); | 34 MOCK_METHOD0(container_view, gfx::NativeView()); |
35 }; | 35 }; |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 class AutofillPopupBaseViewTest : public InProcessBrowserTest { | 39 class AutofillPopupBaseViewTest : public InProcessBrowserTest { |
40 public: | 40 public: |
41 AutofillPopupBaseViewTest() {} | 41 AutofillPopupBaseViewTest() {} |
42 virtual ~AutofillPopupBaseViewTest() {} | 42 virtual ~AutofillPopupBaseViewTest() {} |
43 | 43 |
44 virtual void SetUpOnMainThread() OVERRIDE { | 44 virtual void SetUpOnMainThread() override { |
45 gfx::NativeView native_view = | 45 gfx::NativeView native_view = |
46 browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView(); | 46 browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView(); |
47 EXPECT_CALL(mock_delegate_, container_view()) | 47 EXPECT_CALL(mock_delegate_, container_view()) |
48 .WillRepeatedly(Return(native_view)); | 48 .WillRepeatedly(Return(native_view)); |
49 EXPECT_CALL(mock_delegate_, ViewDestroyed()); | 49 EXPECT_CALL(mock_delegate_, ViewDestroyed()); |
50 | 50 |
51 view_ = | 51 view_ = |
52 new AutofillPopupBaseView(&mock_delegate_, | 52 new AutofillPopupBaseView(&mock_delegate_, |
53 views::Widget::GetWidgetForNativeWindow( | 53 views::Widget::GetWidgetForNativeWindow( |
54 browser()->window()->GetNativeWindow())); | 54 browser()->window()->GetNativeWindow())); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 ShowView(); | 139 ShowView(); |
140 | 140 |
141 gfx::Point display_point = | 141 gfx::Point display_point = |
142 static_cast<views::View*>(view_)->GetBoundsInScreen().origin(); | 142 static_cast<views::View*>(view_)->GetBoundsInScreen().origin(); |
143 gfx::Point expected_point = bounds.origin(); | 143 gfx::Point expected_point = bounds.origin(); |
144 EXPECT_EQ(expected_point, display_point); | 144 EXPECT_EQ(expected_point, display_point); |
145 } | 145 } |
146 | 146 |
147 } // namespace autofill | 147 } // namespace autofill |
OLD | NEW |