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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 is_running_(false) { | 230 is_running_(false) { |
231 } | 231 } |
232 | 232 |
233 TestMoveLoop::~TestMoveLoop() { | 233 TestMoveLoop::~TestMoveLoop() { |
234 } | 234 } |
235 | 235 |
236 bool TestMoveLoop::IsRunning() const { | 236 bool TestMoveLoop::IsRunning() const { |
237 return is_running_; | 237 return is_running_; |
238 } | 238 } |
239 | 239 |
240 bool TestMoveLoop::RunMoveLoop( | 240 bool TestMoveLoop::RunMoveLoop(aura::Window* window) { |
241 aura::Window* window, | |
242 gfx::NativeCursor cursor) { | |
243 is_running_ = true; | 241 is_running_ = true; |
244 base::RunLoop run_loop; | 242 base::RunLoop run_loop; |
245 quit_closure_ = run_loop.QuitClosure(); | 243 quit_closure_ = run_loop.QuitClosure(); |
246 run_loop.Run(); | 244 run_loop.Run(); |
247 return true; | 245 return true; |
248 } | 246 } |
249 | 247 |
250 void TestMoveLoop::UpdateCursor(gfx::NativeCursor cursor) { | 248 void TestMoveLoop::UpdateCursor(gfx::NativeCursor cursor) { |
251 } | 249 } |
252 | 250 |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 // the aura::client::DragDropDelegate is properly notified. | 956 // the aura::client::DragDropDelegate is properly notified. |
959 TEST_F(DesktopDragDropClientAuraX11ChromeSourceTargetTest, CtrlPressed) { | 957 TEST_F(DesktopDragDropClientAuraX11ChromeSourceTargetTest, CtrlPressed) { |
960 base::MessageLoop::current()->PostTask( | 958 base::MessageLoop::current()->PostTask( |
961 FROM_HERE, | 959 FROM_HERE, |
962 base::Bind(&ChromeSourceTargetStep2, client(), ui::EF_CONTROL_DOWN)); | 960 base::Bind(&ChromeSourceTargetStep2, client(), ui::EF_CONTROL_DOWN)); |
963 int result = StartDragAndDrop(); | 961 int result = StartDragAndDrop(); |
964 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, result); | 962 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, result); |
965 } | 963 } |
966 | 964 |
967 } // namespace views | 965 } // namespace views |
OLD | NEW |