Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_popup_base_view_browsertest.cc

Issue 870833002: [android] Autofill popup behavior fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update expectations of old test and add a new test. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 AutofillPopupBaseViewTest() {} 43 AutofillPopupBaseViewTest() {}
44 virtual ~AutofillPopupBaseViewTest() {} 44 virtual ~AutofillPopupBaseViewTest() {}
45 45
46 virtual void SetUpOnMainThread() override { 46 virtual void SetUpOnMainThread() override {
47 gfx::NativeView native_view = 47 gfx::NativeView native_view =
48 browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView(); 48 browser()->tab_strip_model()->GetActiveWebContents()->GetNativeView();
49 EXPECT_CALL(mock_delegate_, container_view()) 49 EXPECT_CALL(mock_delegate_, container_view())
50 .WillRepeatedly(Return(native_view)); 50 .WillRepeatedly(Return(native_view));
51 EXPECT_CALL(mock_delegate_, ViewDestroyed()); 51 EXPECT_CALL(mock_delegate_, ViewDestroyed());
52 52
53 view_ = 53 view_ = new AutofillPopupBaseView(
54 new AutofillPopupBaseView(&mock_delegate_, 54 &mock_delegate_,
55 views::Widget::GetWidgetForNativeWindow( 55 views::Widget::GetWidgetForNativeWindow(
56 browser()->window()->GetNativeWindow())); 56 browser()->window()->GetNativeWindow())->GetFocusManager());
57 } 57 }
58 58
59 void ShowView() { 59 void ShowView() {
60 view_->DoShow(); 60 view_->DoShow();
61 } 61 }
62 62
63 ui::GestureEvent CreateGestureEvent(ui::EventType type, gfx::Point point) { 63 ui::GestureEvent CreateGestureEvent(ui::EventType type, gfx::Point point) {
64 return ui::GestureEvent(point.x(), 64 return ui::GestureEvent(point.x(),
65 point.y(), 65 point.y(),
66 0, 66 0,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 ShowView(); 141 ShowView();
142 142
143 gfx::Point display_point = 143 gfx::Point display_point =
144 static_cast<views::View*>(view_)->GetBoundsInScreen().origin(); 144 static_cast<views::View*>(view_)->GetBoundsInScreen().origin();
145 gfx::Point expected_point = bounds.origin(); 145 gfx::Point expected_point = bounds.origin();
146 EXPECT_EQ(expected_point, display_point); 146 EXPECT_EQ(expected_point, display_point);
147 } 147 }
148 148
149 } // namespace autofill 149 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698