Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Side by Side Diff: ash/drag_drop/drag_drop_controller_unittest.cc

Issue 251543003: Unified Gesture Recognizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/ash.gyp ('k') | content/browser/frame_host/render_widget_host_view_guest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/drag_drop/drag_drop_tracker.h" 7 #include "ash/drag_drop/drag_drop_tracker.h"
8 #include "ash/drag_drop/drag_image_view.h" 8 #include "ash/drag_drop/drag_image_view.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "ui/aura/client/capture_client.h" 14 #include "ui/aura/client/capture_client.h"
15 #include "ui/aura/test/event_generator.h" 15 #include "ui/aura/test/event_generator.h"
16 #include "ui/aura/window_event_dispatcher.h" 16 #include "ui/aura/window_event_dispatcher.h"
17 #include "ui/aura/window_tree_host.h" 17 #include "ui/aura/window_tree_host.h"
18 #include "ui/base/clipboard/clipboard.h" 18 #include "ui/base/clipboard/clipboard.h"
19 #include "ui/base/clipboard/scoped_clipboard_writer.h" 19 #include "ui/base/clipboard/scoped_clipboard_writer.h"
20 #include "ui/base/dragdrop/drag_drop_types.h" 20 #include "ui/base/dragdrop/drag_drop_types.h"
21 #include "ui/base/dragdrop/drag_utils.h" 21 #include "ui/base/dragdrop/drag_utils.h"
22 #include "ui/base/dragdrop/os_exchange_data.h" 22 #include "ui/base/dragdrop/os_exchange_data.h"
23 #include "ui/base/ui_base_switches.h" 23 #include "ui/base/ui_base_switches.h"
24 #include "ui/events/event.h" 24 #include "ui/events/event.h"
25 #include "ui/events/event_utils.h" 25 #include "ui/events/event_utils.h"
26 #include "ui/events/gestures/gesture_types.h" 26 #include "ui/events/gestures/gesture_types.h"
27 #include "ui/events/test/events_test_utils.h"
27 #include "ui/gfx/animation/linear_animation.h" 28 #include "ui/gfx/animation/linear_animation.h"
28 #include "ui/gfx/image/image_skia_rep.h" 29 #include "ui/gfx/image/image_skia_rep.h"
29 #include "ui/views/test/test_views_delegate.h" 30 #include "ui/views/test/test_views_delegate.h"
30 #include "ui/views/view.h" 31 #include "ui/views/view.h"
31 #include "ui/views/views_delegate.h" 32 #include "ui/views/views_delegate.h"
32 #include "ui/views/widget/native_widget_aura.h" 33 #include "ui/views/widget/native_widget_aura.h"
33 #include "ui/views/widget/native_widget_delegate.h" 34 #include "ui/views/widget/native_widget_delegate.h"
34 #include "ui/views/widget/widget.h" 35 #include "ui/views/widget/widget.h"
35 36
36 namespace ash { 37 namespace ash {
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 276
276 void DispatchGesture(ui::EventType gesture_type, gfx::Point location) { 277 void DispatchGesture(ui::EventType gesture_type, gfx::Point location) {
277 ui::GestureEvent gesture_event( 278 ui::GestureEvent gesture_event(
278 gesture_type, 279 gesture_type,
279 location.x(), 280 location.x(),
280 location.y(), 281 location.y(),
281 0, 282 0,
282 ui::EventTimeForNow(), 283 ui::EventTimeForNow(),
283 ui::GestureEventDetails(gesture_type, 0, 0), 284 ui::GestureEventDetails(gesture_type, 0, 0),
284 1); 285 1);
285 Shell::GetPrimaryRootWindow()->GetHost()->dispatcher()->DispatchGestureEvent( 286 ui::EventSource* event_source =
286 &gesture_event); 287 Shell::GetPrimaryRootWindow()->GetHost()->GetEventSource();
288 ui::EventSourceTestApi event_source_test(event_source);
289 ui::EventDispatchDetails details =
290 event_source_test.SendEventToProcessor(&gesture_event);
291 CHECK(!details.dispatcher_destroyed);
287 } 292 }
288 293
289 } // namespace 294 } // namespace
290 295
291 class DragDropControllerTest : public AshTestBase { 296 class DragDropControllerTest : public AshTestBase {
292 public: 297 public:
293 DragDropControllerTest() : AshTestBase() {} 298 DragDropControllerTest() : AshTestBase() {}
294 virtual ~DragDropControllerTest() {} 299 virtual ~DragDropControllerTest() {}
295 300
296 virtual void SetUp() OVERRIDE { 301 virtual void SetUp() OVERRIDE {
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); 1083 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString());
1079 } 1084 }
1080 for (aura::Window::Windows::iterator iter = root_windows.begin(); 1085 for (aura::Window::Windows::iterator iter = root_windows.begin();
1081 iter != root_windows.end(); ++iter) { 1086 iter != root_windows.end(); ++iter) {
1082 aura::client::SetDragDropClient(*iter, NULL); 1087 aura::client::SetDragDropClient(*iter, NULL);
1083 } 1088 }
1084 } 1089 }
1085 1090
1086 } // namespace test 1091 } // namespace test
1087 } // namespace aura 1092 } // namespace aura
OLDNEW
« no previous file with comments | « ash/ash.gyp ('k') | content/browser/frame_host/render_widget_host_view_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698