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

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

Issue 10824295: Rid the world of the last of views::Event types: TouchEvent, GestureEvent, MouseWheelEvent, ScrollE… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « no previous file | ash/launcher/launcher_button.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/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/location.h" 9 #include "base/location.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "ui/aura/root_window.h" 11 #include "ui/aura/root_window.h"
12 #include "ui/aura/test/event_generator.h" 12 #include "ui/aura/test/event_generator.h"
13 #include "ui/base/clipboard/clipboard.h" 13 #include "ui/base/clipboard/clipboard.h"
14 #include "ui/base/clipboard/scoped_clipboard_writer.h" 14 #include "ui/base/clipboard/scoped_clipboard_writer.h"
15 #include "ui/base/dragdrop/drag_drop_types.h" 15 #include "ui/base/dragdrop/drag_drop_types.h"
16 #include "ui/base/dragdrop/os_exchange_data.h" 16 #include "ui/base/dragdrop/os_exchange_data.h"
17 #include "ui/base/event.h" 17 #include "ui/base/event.h"
18 #include "ui/views/events/event.h"
19 #include "ui/views/test/test_views_delegate.h" 18 #include "ui/views/test/test_views_delegate.h"
20 #include "ui/views/view.h" 19 #include "ui/views/view.h"
21 #include "ui/views/views_delegate.h" 20 #include "ui/views/views_delegate.h"
22 #include "ui/views/widget/native_widget_aura.h" 21 #include "ui/views/widget/native_widget_aura.h"
23 #include "ui/views/widget/native_widget_delegate.h" 22 #include "ui/views/widget/native_widget_delegate.h"
24 #include "ui/views/widget/widget.h" 23 #include "ui/views/widget/widget.h"
25 24
26 namespace ash { 25 namespace ash {
27 namespace test { 26 namespace test {
28 27
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 bool GetDropFormats(int* formats, 73 bool GetDropFormats(int* formats,
75 std::set<OSExchangeData::CustomFormat>* custom_formats) { 74 std::set<OSExchangeData::CustomFormat>* custom_formats) {
76 *formats = ui::OSExchangeData::STRING; 75 *formats = ui::OSExchangeData::STRING;
77 return true; 76 return true;
78 } 77 }
79 78
80 bool CanDrop(const OSExchangeData& data) OVERRIDE { 79 bool CanDrop(const OSExchangeData& data) OVERRIDE {
81 return true; 80 return true;
82 } 81 }
83 82
84 void OnDragEntered(const views::DropTargetEvent& event) OVERRIDE { 83 void OnDragEntered(const ui::DropTargetEvent& event) OVERRIDE {
85 num_drag_enters_++; 84 num_drag_enters_++;
86 } 85 }
87 86
88 int OnDragUpdated(const views::DropTargetEvent& event) OVERRIDE { 87 int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE {
89 num_drag_updates_++; 88 num_drag_updates_++;
90 return ui::DragDropTypes::DRAG_COPY; 89 return ui::DragDropTypes::DRAG_COPY;
91 } 90 }
92 91
93 void OnDragExited() OVERRIDE { 92 void OnDragExited() OVERRIDE {
94 num_drag_exits_++; 93 num_drag_exits_++;
95 } 94 }
96 95
97 int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE { 96 int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE {
98 num_drops_++; 97 num_drops_++;
99 return ui::DragDropTypes::DRAG_COPY; 98 return ui::DragDropTypes::DRAG_COPY;
100 } 99 }
101 100
102 void OnDragDone() OVERRIDE { 101 void OnDragDone() OVERRIDE {
103 drag_done_received_ = true; 102 drag_done_received_ = true;
104 } 103 }
105 104
106 DISALLOW_COPY_AND_ASSIGN(DragTestView); 105 DISALLOW_COPY_AND_ASSIGN(DragTestView);
107 }; 106 };
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 EXPECT_EQ(1, drag_view->num_drag_enters_); 665 EXPECT_EQ(1, drag_view->num_drag_enters_);
667 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), 666 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(),
668 drag_view->num_drag_updates_); 667 drag_view->num_drag_updates_);
669 EXPECT_EQ(0, drag_view->num_drops_); 668 EXPECT_EQ(0, drag_view->num_drops_);
670 EXPECT_EQ(1, drag_view->num_drag_exits_); 669 EXPECT_EQ(1, drag_view->num_drag_exits_);
671 EXPECT_TRUE(drag_view->drag_done_received_); 670 EXPECT_TRUE(drag_view->drag_done_received_);
672 } 671 }
673 672
674 } // namespace test 673 } // namespace test
675 } // namespace aura 674 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ash/launcher/launcher_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698