OLD | NEW |
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // loop. | 79 // loop. |
80 class TestMoveLoop : public X11MoveLoop { | 80 class TestMoveLoop : public X11MoveLoop { |
81 public: | 81 public: |
82 explicit TestMoveLoop(X11MoveLoopDelegate* delegate); | 82 explicit TestMoveLoop(X11MoveLoopDelegate* delegate); |
83 ~TestMoveLoop() override; | 83 ~TestMoveLoop() override; |
84 | 84 |
85 // Returns true if the move loop is running. | 85 // Returns true if the move loop is running. |
86 bool IsRunning() const; | 86 bool IsRunning() const; |
87 | 87 |
88 // X11MoveLoop: | 88 // X11MoveLoop: |
89 bool RunMoveLoop(aura::Window* window, gfx::NativeCursor cursor) override; | 89 bool RunMoveLoop(aura::Window* window) override; |
90 void UpdateCursor(gfx::NativeCursor cursor) override; | 90 void UpdateCursor(gfx::NativeCursor cursor) override; |
91 void EndMoveLoop() override; | 91 void EndMoveLoop() override; |
92 | 92 |
93 private: | 93 private: |
94 // Not owned. | 94 // Not owned. |
95 X11MoveLoopDelegate* delegate_; | 95 X11MoveLoopDelegate* delegate_; |
96 | 96 |
97 // Ends the move loop. | 97 // Ends the move loop. |
98 base::Closure quit_closure_; | 98 base::Closure quit_closure_; |
99 | 99 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 is_running_(false) { | 209 is_running_(false) { |
210 } | 210 } |
211 | 211 |
212 TestMoveLoop::~TestMoveLoop() { | 212 TestMoveLoop::~TestMoveLoop() { |
213 } | 213 } |
214 | 214 |
215 bool TestMoveLoop::IsRunning() const { | 215 bool TestMoveLoop::IsRunning() const { |
216 return is_running_; | 216 return is_running_; |
217 } | 217 } |
218 | 218 |
219 bool TestMoveLoop::RunMoveLoop( | 219 bool TestMoveLoop::RunMoveLoop(aura::Window* window) { |
220 aura::Window* window, | |
221 gfx::NativeCursor cursor) { | |
222 is_running_ = true; | 220 is_running_ = true; |
223 base::RunLoop run_loop; | 221 base::RunLoop run_loop; |
224 quit_closure_ = run_loop.QuitClosure(); | 222 quit_closure_ = run_loop.QuitClosure(); |
225 run_loop.Run(); | 223 run_loop.Run(); |
226 return true; | 224 return true; |
227 } | 225 } |
228 | 226 |
229 void TestMoveLoop::UpdateCursor(gfx::NativeCursor cursor) { | 227 void TestMoveLoop::UpdateCursor(gfx::NativeCursor cursor) { |
230 } | 228 } |
231 | 229 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 712 |
715 // Repeat the test but reject the drop in the XdndFinished message instead. | 713 // Repeat the test but reject the drop in the XdndFinished message instead. |
716 base::MessageLoop::current()->PostTask( | 714 base::MessageLoop::current()->PostTask( |
717 FROM_HERE, | 715 FROM_HERE, |
718 base::Bind(&RejectAfterMouseReleaseStep3, client())); | 716 base::Bind(&RejectAfterMouseReleaseStep3, client())); |
719 result = StartDragAndDrop(); | 717 result = StartDragAndDrop(); |
720 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); | 718 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); |
721 } | 719 } |
722 | 720 |
723 } // namespace views | 721 } // namespace views |
OLD | NEW |