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

Side by Side Diff: services/ui/ws/cursor_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return w; 83 return w;
84 } 84 }
85 85
86 void MoveCursorTo(const gfx::Point& p) { 86 void MoveCursorTo(const gfx::Point& p) {
87 DisplayManager* display_manager = window_server()->display_manager(); 87 DisplayManager* display_manager = window_server()->display_manager();
88 ASSERT_EQ(1u, display_manager->displays().size()); 88 ASSERT_EQ(1u, display_manager->displays().size());
89 Display* display = *display_manager->displays().begin(); 89 Display* display = *display_manager->displays().begin();
90 WindowManagerDisplayRoot* active_display_root = 90 WindowManagerDisplayRoot* active_display_root =
91 display->GetActiveWindowManagerDisplayRoot(); 91 display->GetActiveWindowManagerDisplayRoot();
92 ASSERT_TRUE(active_display_root); 92 ASSERT_TRUE(active_display_root);
93 PointerEvent event( 93 PointerEvent event(MouseEvent(
94 MouseEvent(ET_MOUSE_MOVED, p, p, base::TimeTicks(), 0, 0)); 94 ET_MOUSE_MOVED, p, p, base::TimeTicks(), 0, 0,
95 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
95 ignore_result(static_cast<PlatformDisplayDelegate*>(display) 96 ignore_result(static_cast<PlatformDisplayDelegate*>(display)
96 ->GetEventSink() 97 ->GetEventSink()
97 ->OnEventFromSource(&event)); 98 ->OnEventFromSource(&event));
98 WindowManagerState* wms = active_display_root->window_manager_state(); 99 WindowManagerState* wms = active_display_root->window_manager_state();
99 wms->OnEventAck(wms->window_tree(), mojom::EventResult::HANDLED); 100 wms->OnEventAck(wms->window_tree(), mojom::EventResult::HANDLED);
100 } 101 }
101 102
102 private: 103 private:
103 WindowServerTestHelper ws_test_helper_; 104 WindowServerTestHelper ws_test_helper_;
104 TestScreenManager screen_manager_; 105 TestScreenManager screen_manager_;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 MoveCursorTo(gfx::Point(15, 15)); 181 MoveCursorTo(gfx::Point(15, 15));
181 EXPECT_EQ(mojom::CursorType::EAST_RESIZE, cursor()); 182 EXPECT_EQ(mojom::CursorType::EAST_RESIZE, cursor());
182 183
183 win->SetBounds(gfx::Rect(0, 0, 30, 30)); 184 win->SetBounds(gfx::Rect(0, 0, 30, 30));
184 EXPECT_EQ(mojom::CursorType::COPY, cursor()); 185 EXPECT_EQ(mojom::CursorType::COPY, cursor());
185 } 186 }
186 187
187 } // namespace test 188 } // namespace test
188 } // namespace ws 189 } // namespace ws
189 } // namespace ui 190 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698