OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/drag_drop/drag_drop_controller.h" | 5 #include "ash/drag_drop/drag_drop_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_interactive_ui_test_base.h" | 8 #include "ash/test/ash_interactive_ui_test_base.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 widget->SetContentsView(contents_view); | 79 widget->SetContentsView(contents_view); |
80 widget->Show(); | 80 widget->Show(); |
81 return widget; | 81 return widget; |
82 } | 82 } |
83 | 83 |
84 void QuitLoop() { | 84 void QuitLoop() { |
85 base::MessageLoop::current()->QuitWhenIdle(); | 85 base::MessageLoop::current()->QuitWhenIdle(); |
86 } | 86 } |
87 | 87 |
88 void DragDropAcrossMultiDisplay_Step4() { | 88 void DragDropAcrossMultiDisplay_Step4() { |
89 ui_controls::SendMouseEventsNotifyWhenDone( | 89 ui_controls::SendMouseEventsNotifyWhenDone(ui_controls::LEFT, ui_controls::UP, |
90 ui_controls::LEFT, ui_controls::UP, | 90 base::Bind(&QuitLoop)); |
91 base::Bind(&QuitLoop)); | |
92 } | 91 } |
93 | 92 |
94 void DragDropAcrossMultiDisplay_Step3() { | 93 void DragDropAcrossMultiDisplay_Step3() { |
95 // Move to the edge of the 1st display so that the mouse | 94 // Move to the edge of the 1st display so that the mouse |
96 // is moved to 2nd display by ash. | 95 // is moved to 2nd display by ash. |
97 ui_controls::SendMouseMoveNotifyWhenDone( | 96 ui_controls::SendMouseMoveNotifyWhenDone( |
98 399, 10, | 97 399, 10, base::Bind(&DragDropAcrossMultiDisplay_Step4)); |
99 base::Bind(&DragDropAcrossMultiDisplay_Step4)); | |
100 } | 98 } |
101 | 99 |
102 void DragDropAcrossMultiDisplay_Step2() { | 100 void DragDropAcrossMultiDisplay_Step2() { |
103 ui_controls::SendMouseMoveNotifyWhenDone( | 101 ui_controls::SendMouseMoveNotifyWhenDone( |
104 20, 10, | 102 20, 10, base::Bind(&DragDropAcrossMultiDisplay_Step3)); |
105 base::Bind(&DragDropAcrossMultiDisplay_Step3)); | |
106 } | 103 } |
107 | 104 |
108 void DragDropAcrossMultiDisplay_Step1() { | 105 void DragDropAcrossMultiDisplay_Step1() { |
109 ui_controls::SendMouseEventsNotifyWhenDone( | 106 ui_controls::SendMouseEventsNotifyWhenDone( |
110 ui_controls::LEFT, ui_controls::DOWN, | 107 ui_controls::LEFT, ui_controls::DOWN, |
111 base::Bind(&DragDropAcrossMultiDisplay_Step2)); | 108 base::Bind(&DragDropAcrossMultiDisplay_Step2)); |
112 } | 109 } |
113 | 110 |
114 } // namespace | 111 } // namespace |
115 | 112 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 147 |
151 base::MessageLoop::current()->Run(); | 148 base::MessageLoop::current()->Run(); |
152 | 149 |
153 EXPECT_TRUE(target_view->dropped()); | 150 EXPECT_TRUE(target_view->dropped()); |
154 | 151 |
155 source->Close(); | 152 source->Close(); |
156 target->Close(); | 153 target->Close(); |
157 } | 154 } |
158 | 155 |
159 } // namespace ash | 156 } // namespace ash |
OLD | NEW |