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

Side by Side Diff: services/ui/ws/window_tree_unittest.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 "services/ui/ws/window_tree.h" 5 #include "services/ui/ws/window_tree.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1))); 69 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_TOUCH, 1)));
70 } 70 }
71 71
72 ui::PointerEvent CreatePointerWheelEvent(int x, int y) { 72 ui::PointerEvent CreatePointerWheelEvent(int x, int y) {
73 return ui::PointerEvent( 73 return ui::PointerEvent(
74 ui::MouseWheelEvent(gfx::Vector2d(), gfx::Point(x, y), gfx::Point(x, y), 74 ui::MouseWheelEvent(gfx::Vector2d(), gfx::Point(x, y), gfx::Point(x, y),
75 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE)); 75 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE));
76 } 76 }
77 77
78 ui::PointerEvent CreateMouseMoveEvent(int x, int y) { 78 ui::PointerEvent CreateMouseMoveEvent(int x, int y) {
79 return ui::PointerEvent( 79 return ui::PointerEvent(ui::MouseEvent(
80 ui::MouseEvent(ui::ET_MOUSE_MOVED, gfx::Point(x, y), gfx::Point(x, y), 80 ui::ET_MOUSE_MOVED, gfx::Point(x, y), gfx::Point(x, y),
81 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE)); 81 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE,
82 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
82 } 83 }
83 84
84 ui::PointerEvent CreateMouseDownEvent(int x, int y) { 85 ui::PointerEvent CreateMouseDownEvent(int x, int y) {
85 return ui::PointerEvent( 86 return ui::PointerEvent(ui::MouseEvent(
86 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(x, y), gfx::Point(x, y), 87 ui::ET_MOUSE_PRESSED, gfx::Point(x, y), gfx::Point(x, y),
87 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 88 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
88 ui::EF_LEFT_MOUSE_BUTTON)); 89 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
89 } 90 }
90 91
91 ui::PointerEvent CreateMouseUpEvent(int x, int y) { 92 ui::PointerEvent CreateMouseUpEvent(int x, int y) {
92 return ui::PointerEvent( 93 return ui::PointerEvent(ui::MouseEvent(
93 ui::MouseEvent(ui::ET_MOUSE_RELEASED, gfx::Point(x, y), gfx::Point(x, y), 94 ui::ET_MOUSE_RELEASED, gfx::Point(x, y), gfx::Point(x, y),
94 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 95 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
95 ui::EF_LEFT_MOUSE_BUTTON)); 96 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
96 } 97 }
97 98
98 ServerWindow* GetCaptureWindow(Display* display) { 99 ServerWindow* GetCaptureWindow(Display* display) {
99 return display->GetActiveWindowManagerDisplayRoot() 100 return display->GetActiveWindowManagerDisplayRoot()
100 ->window_manager_state() 101 ->window_manager_state()
101 ->capture_window(); 102 ->capture_window();
102 } 103 }
103 104
104 class TestMoveLoopWindowManager : public TestWindowManager { 105 class TestMoveLoopWindowManager : public TestWindowManager {
105 public: 106 public:
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 client->tracker()->changes()->clear(); 1502 client->tracker()->changes()->clear();
1502 } 1503 }
1503 1504
1504 // Client should not have got any messages after shutdown. 1505 // Client should not have got any messages after shutdown.
1505 EXPECT_TRUE(client->tracker()->changes()->empty()); 1506 EXPECT_TRUE(client->tracker()->changes()->empty());
1506 } 1507 }
1507 1508
1508 } // namespace test 1509 } // namespace test
1509 } // namespace ws 1510 } // namespace ws
1510 } // namespace ui 1511 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698