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

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

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 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 "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" 8 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 gfx::Point(100, 100)); 120 gfx::Point(100, 100));
121 SimulateGesture(&outside_tap); 121 SimulateGesture(&outside_tap);
122 } 122 }
123 123
124 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, DoubleClickTest) { 124 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, DoubleClickTest) {
125 gfx::Rect bounds(0, 0, 5, 5); 125 gfx::Rect bounds(0, 0, 5, 5);
126 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(Return(bounds)); 126 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(Return(bounds));
127 127
128 ShowView(); 128 ShowView();
129 129
130 ui::MouseEvent mouse_down(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), 130 ui::MouseEvent mouse_down(
131 gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0); 131 ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0),
132 ui::EventTimeForNow(), 0, 0,
133 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
132 EXPECT_TRUE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down)); 134 EXPECT_TRUE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down));
133 135
134 // Ignore double clicks. 136 // Ignore double clicks.
135 mouse_down.SetClickCount(2); 137 mouse_down.SetClickCount(2);
136 EXPECT_FALSE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down)); 138 EXPECT_FALSE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down));
137 } 139 }
138 140
139 // Regression test for crbug.com/391316 141 // Regression test for crbug.com/391316
140 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, CorrectBoundsTest) { 142 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, CorrectBoundsTest) {
141 gfx::Rect bounds(100, 150, 5, 5); 143 gfx::Rect bounds(100, 150, 5, 5);
142 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(Return(bounds)); 144 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(Return(bounds));
143 145
144 ShowView(); 146 ShowView();
145 147
146 gfx::Point display_point = 148 gfx::Point display_point =
147 static_cast<views::View*>(view_)->GetBoundsInScreen().origin(); 149 static_cast<views::View*>(view_)->GetBoundsInScreen().origin();
148 gfx::Point expected_point = bounds.origin(); 150 gfx::Point expected_point = bounds.origin();
149 EXPECT_EQ(expected_point, display_point); 151 EXPECT_EQ(expected_point, display_point);
150 } 152 }
151 153
152 } // namespace autofill 154 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698