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

Side by Side Diff: ui/views/mus/drag_interactive_uitest.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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "services/ui/public/interfaces/window_server_test.mojom.h" 6 #include "services/ui/public/interfaces/window_server_test.mojom.h"
7 #include "services/ui/public/interfaces/window_tree_constants.mojom.h" 7 #include "services/ui/public/interfaces/window_tree_constants.mojom.h"
8 #include "ui/aura/mus/in_flight_change.h" 8 #include "ui/aura/mus/in_flight_change.h"
9 #include "ui/aura/mus/window_tree_host_mus.h" 9 #include "ui/aura/mus/window_tree_host_mus.h"
10 #include "ui/aura/test/mus/change_completion_waiter.h" 10 #include "ui/aura/test/mus/change_completion_waiter.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bool dropped_; 78 bool dropped_;
79 79
80 base::Closure quit_closure_; 80 base::Closure quit_closure_;
81 81
82 DISALLOW_COPY_AND_ASSIGN(TargetView); 82 DISALLOW_COPY_AND_ASSIGN(TargetView);
83 }; 83 };
84 84
85 std::unique_ptr<ui::PointerEvent> CreateMouseMoveEvent(int x, int y) { 85 std::unique_ptr<ui::PointerEvent> CreateMouseMoveEvent(int x, int y) {
86 return base::MakeUnique<ui::PointerEvent>(ui::MouseEvent( 86 return base::MakeUnique<ui::PointerEvent>(ui::MouseEvent(
87 ui::ET_MOUSE_MOVED, gfx::Point(x, y), gfx::Point(x, y), 87 ui::ET_MOUSE_MOVED, gfx::Point(x, y), gfx::Point(x, y),
88 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_NONE)); 88 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_NONE,
89 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
89 } 90 }
90 91
91 std::unique_ptr<ui::PointerEvent> CreateMouseDownEvent(int x, int y) { 92 std::unique_ptr<ui::PointerEvent> CreateMouseDownEvent(int x, int y) {
92 return base::MakeUnique<ui::PointerEvent>( 93 return base::MakeUnique<ui::PointerEvent>(ui::MouseEvent(
93 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(x, y), gfx::Point(x, y), 94 ui::ET_MOUSE_PRESSED, 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 std::unique_ptr<ui::PointerEvent> CreateMouseUpEvent(int x, int y) { 99 std::unique_ptr<ui::PointerEvent> CreateMouseUpEvent(int x, int y) {
99 return base::MakeUnique<ui::PointerEvent>( 100 return base::MakeUnique<ui::PointerEvent>(ui::MouseEvent(
100 ui::MouseEvent(ui::ET_MOUSE_RELEASED, gfx::Point(x, y), gfx::Point(x, y), 101 ui::ET_MOUSE_RELEASED, gfx::Point(x, y), gfx::Point(x, y),
101 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 102 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON,
102 ui::EF_LEFT_MOUSE_BUTTON)); 103 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)));
103 } 104 }
104 105
105 } // namespace 106 } // namespace
106 107
107 using DragTestInteractive = WidgetTest; 108 using DragTestInteractive = WidgetTest;
108 109
109 // Dispatch of events is asynchronous so most of DragTestInteractive.DragTest 110 // Dispatch of events is asynchronous so most of DragTestInteractive.DragTest
110 // consists of callback functions which will perform an action after the 111 // consists of callback functions which will perform an action after the
111 // previous action has completed. 112 // previous action has completed.
112 void DragTest_Part3(int64_t display_id, 113 void DragTest_Part3(int64_t display_id,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 193
193 EXPECT_TRUE(target_view->dropped()); 194 EXPECT_TRUE(target_view->dropped());
194 195
195 target_widget->Close(); 196 target_widget->Close();
196 source_widget->Close(); 197 source_widget->Close();
197 RunPendingMessages(); 198 RunPendingMessages();
198 } 199 }
199 200
200 } // namespace test 201 } // namespace test
201 } // namespace views 202 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698