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" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "ui/aura/window_event_dispatcher.h" | 12 #include "ui/aura/window_event_dispatcher.h" |
13 #include "ui/base/dragdrop/drag_drop_types.h" | 13 #include "ui/base/dragdrop/drag_drop_types.h" |
14 #include "ui/base/test/ui_controls.h" | 14 #include "ui/base/test/ui_controls.h" |
15 #include "ui/gl/gl_surface.h" | |
15 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
16 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
17 | 18 |
18 namespace ash { | 19 namespace ash { |
19 namespace internal { | 20 namespace internal { |
20 namespace { | 21 namespace { |
21 | 22 |
22 class DraggableView : public views::View { | 23 class DraggableView : public views::View { |
23 public: | 24 public: |
24 DraggableView() {} | 25 DraggableView() {} |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 } | 112 } |
112 | 113 |
113 void DragDropAcrossMultiDisplay_Step1() { | 114 void DragDropAcrossMultiDisplay_Step1() { |
114 ui_controls::SendMouseEventsNotifyWhenDone( | 115 ui_controls::SendMouseEventsNotifyWhenDone( |
115 ui_controls::LEFT, ui_controls::DOWN, | 116 ui_controls::LEFT, ui_controls::DOWN, |
116 base::Bind(&DragDropAcrossMultiDisplay_Step2)); | 117 base::Bind(&DragDropAcrossMultiDisplay_Step2)); |
117 } | 118 } |
118 | 119 |
119 } // namespace | 120 } // namespace |
120 | 121 |
121 typedef test::AshTestBase DragDropTest; | 122 class DragDropTest : public test::AshTestBase { |
123 public: | |
124 DragDropTest() {} | |
125 virtual ~DragDropTest() {} | |
126 | |
127 virtual void SetUp() OVERRIDE { | |
128 gfx::GLSurface::InitializeOneOffForTests(); | |
sky
2014/03/14 21:35:56
Is there a reason you don't want to move this to A
jam
2014/03/14 22:35:40
yeah, it won't work because this test base class r
| |
129 test::AshTestBase::SetUp(); | |
130 } | |
131 }; | |
122 | 132 |
123 #if defined(OS_WIN) | 133 #if defined(OS_WIN) |
124 #define MAYBE_DragDropAcrossMultiDisplay DISABLED_DragDropAcrossMultiDisplay | 134 #define MAYBE_DragDropAcrossMultiDisplay DISABLED_DragDropAcrossMultiDisplay |
125 #else | 135 #else |
126 #define MAYBE_DragDropAcrossMultiDisplay DragDropAcrossMultiDisplay | 136 #define MAYBE_DragDropAcrossMultiDisplay DragDropAcrossMultiDisplay |
127 #endif | 137 #endif |
128 | 138 |
129 // Test if the mouse gets moved properly to another display | 139 // Test if the mouse gets moved properly to another display |
130 // during drag & drop operation. | 140 // during drag & drop operation. |
131 TEST_F(DragDropTest, MAYBE_DragDropAcrossMultiDisplay) { | 141 TEST_F(DragDropTest, MAYBE_DragDropAcrossMultiDisplay) { |
(...skipping 24 matching lines...) Expand all Loading... | |
156 base::MessageLoop::current()->Run(); | 166 base::MessageLoop::current()->Run(); |
157 | 167 |
158 EXPECT_TRUE(target_view->dropped()); | 168 EXPECT_TRUE(target_view->dropped()); |
159 | 169 |
160 source->Close(); | 170 source->Close(); |
161 target->Close(); | 171 target->Close(); |
162 } | 172 } |
163 | 173 |
164 } // namespace internal | 174 } // namespace internal |
165 } // namespace ash | 175 } // namespace ash |
OLD | NEW |