| 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_test_base.h" | 8 #include "ash/test/ash_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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 #define MAYBE_DragDropAcrossMultiDisplay DragDropAcrossMultiDisplay | 126 #define MAYBE_DragDropAcrossMultiDisplay DragDropAcrossMultiDisplay |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 // Test if the mouse gets moved properly to another display | 129 // Test if the mouse gets moved properly to another display |
| 130 // during drag & drop operation. | 130 // during drag & drop operation. |
| 131 TEST_F(DragDropTest, MAYBE_DragDropAcrossMultiDisplay) { | 131 TEST_F(DragDropTest, MAYBE_DragDropAcrossMultiDisplay) { |
| 132 if (!SupportsMultipleDisplays()) | 132 if (!SupportsMultipleDisplays()) |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 UpdateDisplay("400x400,400x400"); | 135 UpdateDisplay("400x400,400x400"); |
| 136 aura::Window::Windows root_windows = | 136 Shell::RootWindowList root_windows = |
| 137 Shell::GetInstance()->GetAllRootWindows(); | 137 Shell::GetInstance()->GetAllRootWindows(); |
| 138 views::View* draggable_view = new DraggableView(); | 138 views::View* draggable_view = new DraggableView(); |
| 139 draggable_view->set_drag_controller(NULL); | 139 draggable_view->set_drag_controller(NULL); |
| 140 draggable_view->SetBounds(0, 0, 100, 100); | 140 draggable_view->SetBounds(0, 0, 100, 100); |
| 141 views::Widget* source = | 141 views::Widget* source = |
| 142 CreateWidget(draggable_view, gfx::Rect(0, 0, 100, 100)); | 142 CreateWidget(draggable_view, gfx::Rect(0, 0, 100, 100)); |
| 143 | 143 |
| 144 TargetView* target_view = new TargetView(); | 144 TargetView* target_view = new TargetView(); |
| 145 target_view->SetBounds(0, 0, 100, 100); | 145 target_view->SetBounds(0, 0, 100, 100); |
| 146 views::Widget* target = | 146 views::Widget* target = |
| 147 CreateWidget(target_view, gfx::Rect(400, 0, 100, 100)); | 147 CreateWidget(target_view, gfx::Rect(400, 0, 100, 100)); |
| 148 | 148 |
| 149 // Make sure they're on the different root windows. | 149 // Make sure they're on the different root windows. |
| 150 EXPECT_EQ(root_windows[0], source->GetNativeView()->GetRootWindow()); | 150 EXPECT_EQ(root_windows[0], source->GetNativeView()->GetRootWindow()); |
| 151 EXPECT_EQ(root_windows[1], target->GetNativeView()->GetRootWindow()); | 151 EXPECT_EQ(root_windows[1], target->GetNativeView()->GetRootWindow()); |
| 152 | 152 |
| 153 ui_controls::SendMouseMoveNotifyWhenDone( | 153 ui_controls::SendMouseMoveNotifyWhenDone( |
| 154 10, 10, base::Bind(&DragDropAcrossMultiDisplay_Step1)); | 154 10, 10, base::Bind(&DragDropAcrossMultiDisplay_Step1)); |
| 155 | 155 |
| 156 base::MessageLoop::current()->Run(); | 156 base::MessageLoop::current()->Run(); |
| 157 | 157 |
| 158 EXPECT_TRUE(target_view->dropped()); | 158 EXPECT_TRUE(target_view->dropped()); |
| 159 | 159 |
| 160 source->Close(); | 160 source->Close(); |
| 161 target->Close(); | 161 target->Close(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace internal | 164 } // namespace internal |
| 165 } // namespace ash | 165 } // namespace ash |
| OLD | NEW |