diff options
author | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 12:11:49 +0000 |
---|---|---|
committer | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-28 12:11:49 +0000 |
commit | ffa4e448cf15245002c286ea781717426aa3eff4 (patch) | |
tree | ca251556ea039f07dfc5a4bb96817aaaac8c656a /ash/drag_drop/drag_drop_tracker_unittest.cc | |
parent | 186b661f7383039cecfb392643349eb0c5fce2a8 (diff) | |
download | chromium_src-ffa4e448cf15245002c286ea781717426aa3eff4.zip chromium_src-ffa4e448cf15245002c286ea781717426aa3eff4.tar.gz chromium_src-ffa4e448cf15245002c286ea781717426aa3eff4.tar.bz2 |
aura: Enable touch initiated drag and drop.
Touch drag/drop in aura follows the following rules:
1. Initiate drag on long press gesture. Give the user a visual cue by showing
a scaled up drag image.
2. Do not initiate dnd if there is no drag image.
3. If, after initiating a drag, the user lifts up their finger without moving,
cancel the drag and show a context menu (this is implemented using the long tap
gesture).
BUG=114755
Review URL: https://chromiumcodereview.appspot.com/11368131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/drag_drop/drag_drop_tracker_unittest.cc')
-rw-r--r-- | ash/drag_drop/drag_drop_tracker_unittest.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc index dfefe82..279e17e 100644 --- a/ash/drag_drop/drag_drop_tracker_unittest.cc +++ b/ash/drag_drop/drag_drop_tracker_unittest.cc @@ -43,11 +43,11 @@ class DragDropTrackerTest : public test::AshTestBase { return target; } - static ui::MouseEvent* ConvertMouseEvent(aura::Window* target, + static ui::LocatedEvent* ConvertEvent(aura::Window* target, const ui::MouseEvent& event) { scoped_ptr<internal::DragDropTracker> tracker( new internal::DragDropTracker); - ui::MouseEvent* converted = tracker->ConvertMouseEvent(target, event); + ui::LocatedEvent* converted = tracker->ConvertEvent(target, event); return converted; } }; @@ -122,12 +122,12 @@ TEST_F(DragDropTrackerTest, MAYBE_GetTarget) { // TODO(mazda): Remove this once ash/wm/coordinate_conversion.h supports // non-X11 platforms. #if defined(USE_X11) -#define MAYBE_ConvertMouseEvent ConvertMouseEvent +#define MAYBE_ConvertEvent ConvertEvent #else -#define MAYBE_ConvertMouseEvent DISABLED_ConvertMouseEvent +#define MAYBE_ConvertEvent DISABLED_ConvertEvent #endif -TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) { +TEST_F(DragDropTrackerTest, MAYBE_ConvertEvent) { Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); EXPECT_EQ(2U, root_windows.size()); @@ -150,8 +150,8 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) { gfx::Point(50, 50), gfx::Point(50, 50), ui::EF_NONE); - scoped_ptr<ui::MouseEvent> converted00(ConvertMouseEvent(window0.get(), - original00)); + scoped_ptr<ui::LocatedEvent> converted00(ConvertEvent(window0.get(), + original00)); EXPECT_EQ(original00.type(), converted00->type()); EXPECT_EQ("50,50", converted00->location().ToString()); EXPECT_EQ("50,50", converted00->root_location().ToString()); @@ -163,8 +163,8 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) { gfx::Point(350, 150), gfx::Point(350, 150), ui::EF_NONE); - scoped_ptr<ui::MouseEvent> converted01(ConvertMouseEvent(window1.get(), - original01)); + scoped_ptr<ui::LocatedEvent> converted01(ConvertEvent(window1.get(), + original01)); EXPECT_EQ(original01.type(), converted01->type()); EXPECT_EQ("50,50", converted01->location().ToString()); EXPECT_EQ("150,150", converted01->root_location().ToString()); @@ -179,8 +179,8 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) { gfx::Point(-150, 50), gfx::Point(-150, 50), ui::EF_NONE); - scoped_ptr<ui::MouseEvent> converted10(ConvertMouseEvent(window0.get(), - original10)); + scoped_ptr<ui::LocatedEvent> converted10(ConvertEvent(window0.get(), + original10)); EXPECT_EQ(original10.type(), converted10->type()); EXPECT_EQ("50,50", converted10->location().ToString()); EXPECT_EQ("50,50", converted10->root_location().ToString()); @@ -192,7 +192,7 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) { gfx::Point(150, 150), gfx::Point(150, 150), ui::EF_NONE); - scoped_ptr<ui::MouseEvent> converted11(ConvertMouseEvent(window1.get(), + scoped_ptr<ui::LocatedEvent> converted11(ConvertEvent(window1.get(), original11)); EXPECT_EQ(original11.type(), converted11->type()); EXPECT_EQ("50,50", converted11->location().ToString()); |