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

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

Issue 1260453006: ui: events: Add a class to hold common touch and stylus properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address build problems, add accessor and unit tests. Created 5 years, 4 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 SimulateGesture(&outside_tap); 114 SimulateGesture(&outside_tap);
115 } 115 }
116 116
117 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, DoubleClickTest) { 117 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, DoubleClickTest) {
118 gfx::Rect bounds(0, 0, 5, 5); 118 gfx::Rect bounds(0, 0, 5, 5);
119 gfx::Point point = bounds.CenterPoint(); 119 gfx::Point point = bounds.CenterPoint();
120 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(ReturnRef(bounds)); 120 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(ReturnRef(bounds));
121 121
122 ShowView(); 122 ShowView();
123 123
124 ui::MouseEvent mouse_down(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), 124 ui::MouseEvent mouse_down(
125 gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0); 125 ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0),
126 ui::EventTimeForNow(), 0, 0,
127 ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
126 EXPECT_TRUE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down)); 128 EXPECT_TRUE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down));
127 129
128 // Ignore double clicks. 130 // Ignore double clicks.
129 mouse_down.SetClickCount(2); 131 mouse_down.SetClickCount(2);
130 EXPECT_FALSE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down)); 132 EXPECT_FALSE(static_cast<views::View*>(view_)->OnMousePressed(mouse_down));
131 } 133 }
132 134
133 // Regression test for crbug.com/391316 135 // Regression test for crbug.com/391316
134 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, CorrectBoundsTest) { 136 IN_PROC_BROWSER_TEST_F(AutofillPopupBaseViewTest, CorrectBoundsTest) {
135 gfx::Rect bounds(100, 150, 5, 5); 137 gfx::Rect bounds(100, 150, 5, 5);
136 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(ReturnRef(bounds)); 138 EXPECT_CALL(mock_delegate_, popup_bounds()).WillRepeatedly(ReturnRef(bounds));
137 139
138 ShowView(); 140 ShowView();
139 141
140 gfx::Point display_point = 142 gfx::Point display_point =
141 static_cast<views::View*>(view_)->GetBoundsInScreen().origin(); 143 static_cast<views::View*>(view_)->GetBoundsInScreen().origin();
142 gfx::Point expected_point = bounds.origin(); 144 gfx::Point expected_point = bounds.origin();
143 EXPECT_EQ(expected_point, display_point); 145 EXPECT_EQ(expected_point, display_point);
144 } 146 }
145 147
146 } // namespace autofill 148 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698