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

Unified Diff: ash/wm/window_manager_unittest.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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/window_manager_unittest.cc
diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc
index 5bad49d732d104fafa93dc203ce9cbb7f1497ec8..39fe491f7ddbf015aa1fed73fd386dce494139d1 100644
--- a/ash/wm/window_manager_unittest.cc
+++ b/ash/wm/window_manager_unittest.cc
@@ -513,8 +513,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
// Resize edges and corners show proper cursors.
window_delegate.set_hittest_code(HTBOTTOM);
- ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move1(
+ ui::ET_MOUSE_MOVED, point1, point1, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorSouthResize, host->last_cursor().native_type());
@@ -522,8 +523,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
window_delegate.set_hittest_code(HTBOTTOMLEFT);
- ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move2(
+ ui::ET_MOUSE_MOVED, point2, point2, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorSouthWestResize, host->last_cursor().native_type());
@@ -531,8 +533,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
window_delegate.set_hittest_code(HTBOTTOMRIGHT);
- ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move1(
+ ui::ET_MOUSE_MOVED, point1, point1, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorSouthEastResize, host->last_cursor().native_type());
@@ -540,8 +543,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
window_delegate.set_hittest_code(HTLEFT);
- ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move2(
+ ui::ET_MOUSE_MOVED, point2, point2, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorWestResize, host->last_cursor().native_type());
@@ -549,8 +553,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
window_delegate.set_hittest_code(HTRIGHT);
- ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move1(
+ ui::ET_MOUSE_MOVED, point1, point1, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorEastResize, host->last_cursor().native_type());
@@ -558,8 +563,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
window_delegate.set_hittest_code(HTTOP);
- ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move2(
+ ui::ET_MOUSE_MOVED, point2, point2, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorNorthResize, host->last_cursor().native_type());
@@ -567,8 +573,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
window_delegate.set_hittest_code(HTTOPLEFT);
- ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move1(
+ ui::ET_MOUSE_MOVED, point1, point1, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorNorthWestResize, host->last_cursor().native_type());
@@ -576,8 +583,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
window_delegate.set_hittest_code(HTTOPRIGHT);
- ui::MouseEvent move2(ui::ET_MOUSE_MOVED, point2, point2,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move2(
+ ui::ET_MOUSE_MOVED, point2, point2, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move2);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorNorthEastResize, host->last_cursor().native_type());
@@ -586,8 +594,9 @@ TEST_F(WindowManagerTest, MouseEventCursors) {
{
// Client area uses null cursor.
window_delegate.set_hittest_code(HTCLIENT);
- ui::MouseEvent move1(ui::ET_MOUSE_MOVED, point1, point1,
- ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent move1(
+ ui::ET_MOUSE_MOVED, point1, point1, ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&move1);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(ui::kCursorNull, host->last_cursor().native_type());
@@ -621,24 +630,27 @@ TEST_F(WindowManagerTest, MAYBE_TransformActivate) {
gfx::Point miss_point(5, 5);
transform.TransformPoint(&miss_point);
- ui::MouseEvent mouseev1(ui::ET_MOUSE_PRESSED, miss_point, miss_point,
- ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent mouseev1(
+ ui::ET_MOUSE_PRESSED, miss_point, miss_point, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor();
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&mouseev1);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(NULL, aura::client::GetFocusClient(w1.get())->GetFocusedWindow());
- ui::MouseEvent mouseup(ui::ET_MOUSE_RELEASED, miss_point, miss_point,
- ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent mouseup(
+ ui::ET_MOUSE_RELEASED, miss_point, miss_point, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
details = dispatcher->OnEventFromSource(&mouseup);
ASSERT_FALSE(details.dispatcher_destroyed);
gfx::Point hit_point(5, 15);
transform.TransformPoint(&hit_point);
- ui::MouseEvent mouseev2(ui::ET_MOUSE_PRESSED, hit_point, hit_point,
- ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
- ui::EF_LEFT_MOUSE_BUTTON);
+ ui::MouseEvent mouseev2(
+ ui::ET_MOUSE_PRESSED, hit_point, hit_point, ui::EventTimeForNow(),
+ ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
details = dispatcher->OnEventFromSource(&mouseev2);
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_TRUE(wm::IsActiveWindow(w1.get()));
@@ -672,8 +684,10 @@ TEST_F(WindowManagerTest, AdditionalFilters) {
ui::EventProcessor* dispatcher = root_window->GetHost()->event_processor();
ui::EventDispatchDetails details = dispatcher->OnEventFromSource(&key_event);
ASSERT_FALSE(details.dispatcher_destroyed);
- ui::MouseEvent mouse_pressed(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0),
- gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent mouse_pressed(
+ ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
details = dispatcher->OnEventFromSource(&mouse_pressed);
ASSERT_FALSE(details.dispatcher_destroyed);
@@ -693,8 +707,10 @@ TEST_F(WindowManagerTest, AdditionalFilters) {
// Dispatches events.
details = dispatcher->OnEventFromSource(&key_event);
ASSERT_FALSE(details.dispatcher_destroyed);
- ui::MouseEvent mouse_released(ui::ET_MOUSE_RELEASED, gfx::Point(0, 0),
- gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0);
+ ui::MouseEvent mouse_released(
+ ui::ET_MOUSE_RELEASED, gfx::Point(0, 0), gfx::Point(0, 0),
+ ui::EventTimeForNow(), 0, 0,
+ ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
details = dispatcher->OnEventFromSource(&mouse_released);
ASSERT_FALSE(details.dispatcher_destroyed);

Powered by Google App Engine
This is Rietveld 408576698