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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc

Issue 821803002: Use XGrabPointer instead of XChangeActivatePointerGrab() to change the cursor during a pointer grab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_capture
Patch Set: Created 5 years, 11 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 <map> 5 #include <map>
6 #include <vector> 6 #include <vector>
7 7
8 // Include views_test_base.h first because the definition of None in X.h 8 // Include views_test_base.h first because the definition of None in X.h
9 // conflicts with the definition of None in gtest-type-util.h 9 // conflicts with the definition of None in gtest-type-util.h
10 #include "ui/views/test/views_test_base.h" 10 #include "ui/views/test/views_test_base.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // loop. 81 // loop.
82 class TestMoveLoop : public X11MoveLoop { 82 class TestMoveLoop : public X11MoveLoop {
83 public: 83 public:
84 explicit TestMoveLoop(X11MoveLoopDelegate* delegate); 84 explicit TestMoveLoop(X11MoveLoopDelegate* delegate);
85 ~TestMoveLoop() override; 85 ~TestMoveLoop() override;
86 86
87 // Returns true if the move loop is running. 87 // Returns true if the move loop is running.
88 bool IsRunning() const; 88 bool IsRunning() const;
89 89
90 // X11MoveLoop: 90 // X11MoveLoop:
91 bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor) override; 91 bool RunMoveLoop(aura::Window* window) override;
92 void UpdateCursor(gfx::NativeCursor cursor) override; 92 void UpdateCursor(gfx::NativeCursor cursor) override;
93 void EndMoveLoop() override; 93 void EndMoveLoop() override;
94 94
95 private: 95 private:
96 // Not owned. 96 // Not owned.
97 X11MoveLoopDelegate* delegate_; 97 X11MoveLoopDelegate* delegate_;
98 98
99 // Ends the move loop. 99 // Ends the move loop.
100 base::Closure quit_closure_; 100 base::Closure quit_closure_;
101 101
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 is_running_(false) { 227 is_running_(false) {
228 } 228 }
229 229
230 TestMoveLoop::~TestMoveLoop() { 230 TestMoveLoop::~TestMoveLoop() {
231 } 231 }
232 232
233 bool TestMoveLoop::IsRunning() const { 233 bool TestMoveLoop::IsRunning() const {
234 return is_running_; 234 return is_running_;
235 } 235 }
236 236
237 bool TestMoveLoop::RunMoveLoop( 237 bool TestMoveLoop::RunMoveLoop(aura::Window* window) {
238 aura::Window* window,
239 gfx::NativeCursor cursor) {
240 is_running_ = true; 238 is_running_ = true;
241 base::RunLoop run_loop; 239 base::RunLoop run_loop;
242 quit_closure_ = run_loop.QuitClosure(); 240 quit_closure_ = run_loop.QuitClosure();
243 run_loop.Run(); 241 run_loop.Run();
244 return true; 242 return true;
245 } 243 }
246 244
247 void TestMoveLoop::UpdateCursor(gfx::NativeCursor cursor) { 245 void TestMoveLoop::UpdateCursor(gfx::NativeCursor cursor) {
248 } 246 }
249 247
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 // the aura::client::DragDropDelegate is properly notified. 952 // the aura::client::DragDropDelegate is properly notified.
955 TEST_F(DesktopDragDropClientAuraX11ChromeSourceTargetTest, CtrlPressed) { 953 TEST_F(DesktopDragDropClientAuraX11ChromeSourceTargetTest, CtrlPressed) {
956 base::MessageLoop::current()->PostTask( 954 base::MessageLoop::current()->PostTask(
957 FROM_HERE, 955 FROM_HERE,
958 base::Bind(&ChromeSourceTargetStep2, client(), ui::EF_CONTROL_DOWN)); 956 base::Bind(&ChromeSourceTargetStep2, client(), ui::EF_CONTROL_DOWN));
959 int result = StartDragAndDrop(); 957 int result = StartDragAndDrop();
960 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, result); 958 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, result);
961 } 959 }
962 960
963 } // namespace views 961 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698