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

Unified Diff: ui/aura/gestures/gesture_recognizer_unittest.cc

Issue 10825050: Introduce RootWindowHostDelegate. The RootWindowHost performs most of its communication with RootWi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/event_filter_unittest.cc ('k') | ui/aura/root_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/gestures/gesture_recognizer_unittest.cc
===================================================================
--- ui/aura/gestures/gesture_recognizer_unittest.cc (revision 148788)
+++ ui/aura/gestures/gesture_recognizer_unittest.cc (working copy)
@@ -372,7 +372,7 @@
time = time + base::TimeDelta::FromMilliseconds(time_step);
TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y),
touch_id, time);
- root_window->DispatchTouchEvent(&move);
+ root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
}
}
@@ -384,7 +384,7 @@
delegate->Reset();
TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(x, y),
touch_id, GetTime());
- root_window->DispatchTouchEvent(&move);
+ root_window->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
}
} // namespace
@@ -405,7 +405,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -422,7 +422,7 @@
kTouchId, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -452,7 +452,7 @@
kTouchId, GetTime());
press.set_radius_x(5);
press.set_radius_y(12);
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -471,7 +471,7 @@
release.set_radius_x(5);
release.set_radius_y(12);
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -495,7 +495,7 @@
kTouchId, GetTime());
press.set_radius_x(8);
press.set_radius_y(14);
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -512,7 +512,7 @@
release.set_radius_x(20);
release.set_radius_y(13);
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -536,7 +536,7 @@
kTouchId, GetTime());
press.set_radius_x(6);
press.set_radius_y(10);
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -552,7 +552,7 @@
base::TimeDelta::FromMilliseconds(50));
move.set_radius_x(8);
move.set_radius_y(12);
- root_window()->DispatchTouchEvent(&move);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -569,7 +569,7 @@
release.set_radius_x(4);
release.set_radius_y(8);
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -593,7 +593,7 @@
kTouchId, GetTime());
press.set_radius_x(7);
press.set_radius_y(10);
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -609,7 +609,7 @@
base::TimeDelta::FromMilliseconds(50));
move.set_radius_x(13);
move.set_radius_y(12);
- root_window()->DispatchTouchEvent(&move);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -625,7 +625,7 @@
base::TimeDelta::FromMilliseconds(50));
move1.set_radius_x(16);
move1.set_radius_y(16);
- root_window()->DispatchTouchEvent(&move1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -641,7 +641,7 @@
base::TimeDelta::FromMilliseconds(50));
move2.set_radius_x(14);
move2.set_radius_y(10);
- root_window()->DispatchTouchEvent(&move2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -658,7 +658,7 @@
release.set_radius_x(8);
release.set_radius_y(9);
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -690,7 +690,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -750,7 +750,7 @@
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -780,7 +780,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(kPositionX, kPositionY),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_EQ(gfx::Rect(kPositionX - radius,
kPositionY - radius,
radius * 2,
@@ -804,7 +804,7 @@
gfx::Point(kPositionX, kPositionY),
kTouchId, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_EQ(gfx::Rect(kPositionX - radius,
kPositionY - radius,
radius * 2,
@@ -826,7 +826,7 @@
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
// Move the touch-point horizontally enough that it is considered a
// horizontal scroll.
@@ -843,7 +843,7 @@
delegate->Reset();
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->scroll_end());
EXPECT_EQ(0, delegate->velocity_x());
@@ -862,7 +862,7 @@
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
// Move the touch-point vertically enough that it is considered a
// vertical scroll.
@@ -879,7 +879,7 @@
delegate->Reset();
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->scroll_end());
EXPECT_EQ(0, delegate->velocity_x());
@@ -898,7 +898,7 @@
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
// Move the touch-point such that a non-rail scroll begins
SendScrollEvent(root_window(), 20, 20, kTouchId, delegate.get());
@@ -913,7 +913,7 @@
delegate->Reset();
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->scroll_end());
EXPECT_EQ(0, delegate->velocity_x());
@@ -943,7 +943,7 @@
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -958,7 +958,7 @@
delegate->Reset();
TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&release1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1);
EXPECT_FALSE(delegate->long_press());
}
@@ -985,7 +985,7 @@
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
EXPECT_TRUE(delegate->tap_down());
// We haven't pressed long enough for a long press to occur
@@ -1000,7 +1000,7 @@
delegate->Reset();
TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&release1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1);
EXPECT_FALSE(delegate->long_press());
}
@@ -1027,7 +1027,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -1038,7 +1038,7 @@
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap.
EXPECT_TRUE(delegate->begin());
@@ -1051,7 +1051,7 @@
delegate->Reset();
TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&release1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1);
EXPECT_FALSE(delegate->long_press());
EXPECT_TRUE(delegate->two_finger_tap());
}
@@ -1068,7 +1068,7 @@
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
// Move the touch-point horizontally enough that it is considered a
// horizontal scroll.
@@ -1110,7 +1110,7 @@
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
// Move the touch-point vertically enough that it is considered a
// vertical scroll.
@@ -1154,7 +1154,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1168,7 +1168,7 @@
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1182,7 +1182,7 @@
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, release.time_stamp() +
base::TimeDelta::FromMilliseconds(1000));
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1197,7 +1197,7 @@
delegate->Reset();
TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 230),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&move);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1211,7 +1211,7 @@
delegate->Reset();
TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(110, 211),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&move1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1224,7 +1224,7 @@
delegate->Reset();
TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(140, 215),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&move2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1238,7 +1238,7 @@
delegate->Reset();
TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&release1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1264,7 +1264,7 @@
queued_delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(queued_delegate->tap());
EXPECT_FALSE(queued_delegate->tap_down());
EXPECT_FALSE(queued_delegate->begin());
@@ -1279,7 +1279,7 @@
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId1, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(queued_delegate->tap());
EXPECT_FALSE(queued_delegate->tap_down());
EXPECT_FALSE(queued_delegate->begin());
@@ -1298,7 +1298,7 @@
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 20),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_FALSE(queued_delegate->begin());
@@ -1310,7 +1310,7 @@
TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(10, 20),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&release2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2);
// Process the first queued event.
queued_delegate->Reset();
@@ -1341,7 +1341,7 @@
queued_delegate->Reset();
TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press3);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3);
EXPECT_FALSE(queued_delegate->tap());
EXPECT_FALSE(queued_delegate->tap_down());
EXPECT_FALSE(queued_delegate->begin());
@@ -1357,7 +1357,7 @@
delegate->Reset();
TouchEvent press4(ui::ET_TOUCH_PRESSED, gfx::Point(103, 203),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press4);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press4);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -1382,7 +1382,7 @@
int x_move = ui::GestureConfiguration::max_touch_move_in_pixels_for_click();
TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(103 + x_move, 203),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&move);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
@@ -1455,7 +1455,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root->DispatchTouchEvent(&press);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1468,7 +1468,7 @@
delegate->Reset();
TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(130, 301),
kTouchId1, GetTime());
- root->DispatchTouchEvent(&move);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1481,7 +1481,7 @@
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
kTouchId2, GetTime());
- root->DispatchTouchEvent(&press2);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap.
EXPECT_FALSE(delegate->double_tap());
@@ -1496,7 +1496,7 @@
delegate->Reset();
TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(95, 201),
kTouchId1, GetTime());
- root->DispatchTouchEvent(&move3);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1512,7 +1512,7 @@
delegate->Reset();
TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15),
kTouchId2, GetTime());
- root->DispatchTouchEvent(&move4);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1529,7 +1529,7 @@
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId1, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root->DispatchTouchEvent(&release);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1544,7 +1544,7 @@
delegate->Reset();
TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10),
kTouchId2, GetTime());
- root->DispatchTouchEvent(&move5);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1569,11 +1569,11 @@
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
// Since the touch points are far enough we will go to pinch rather than two
// finger tap.
EXPECT_TRUE(delegate->pinch_begin());
@@ -1585,7 +1585,7 @@
delegate->Reset();
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_TRUE(delegate->pinch_end());
SendScrollEvent(root_window(), 130, 230, kTouchId2, delegate.get());
@@ -1595,12 +1595,12 @@
delegate->Reset();
TouchEvent press3(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press3);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press3);
// Now the touch points are close. So we will go into two finger tap.
// Move the touch-point enough to break two-finger-tap and enter pinch.
TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(101, 202),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&move2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2);
EXPECT_TRUE(delegate->pinch_begin());
SendScrollEvent(root_window(), 130, 230, kTouchId1, delegate.get());
@@ -1623,7 +1623,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 301),
kTouchId1, GetTime());
- root->DispatchTouchEvent(&press);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1637,7 +1637,7 @@
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
kTouchId2, GetTime());
- root->DispatchTouchEvent(&press2);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap.
EXPECT_FALSE(delegate->double_tap());
@@ -1652,7 +1652,7 @@
delegate->Reset();
TouchEvent move3(ui::ET_TOUCH_MOVED, gfx::Point(65, 201),
kTouchId1, GetTime());
- root->DispatchTouchEvent(&move3);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move3);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1668,7 +1668,7 @@
delegate->Reset();
TouchEvent move4(ui::ET_TOUCH_MOVED, gfx::Point(55, 15),
kTouchId2, GetTime());
- root->DispatchTouchEvent(&move4);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1685,7 +1685,7 @@
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId1, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root->DispatchTouchEvent(&release);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1700,7 +1700,7 @@
delegate->Reset();
TouchEvent move5(ui::ET_TOUCH_MOVED, gfx::Point(25, 10),
kTouchId2, GetTime());
- root->DispatchTouchEvent(&move5);
+ root->AsRootWindowHostDelegate()->OnHostTouchEvent(&move5);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1718,7 +1718,7 @@
TouchEvent release1(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
6, GetTime());
- root_window()->DispatchTouchEvent(&release1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
}
@@ -1756,7 +1756,7 @@
windows[i]->set_id(i);
TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i]->origin(),
i, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
}
// Touches should now be associated with the closest touch within
@@ -1773,10 +1773,10 @@
// Add a touch in the middle associated with windows[2]
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(0, 500),
kNumWindows, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(250, 250),
kNumWindows, GetTime());
- root_window()->DispatchTouchEvent(&move);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
target = gesture_recognizer->GetTargetForLocation(gfx::Point(250, 250));
EXPECT_EQ("2", WindowIDAsString(target));
@@ -1797,7 +1797,7 @@
// Move a touch associated with windows[2] to 1000, 1000
TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(1000, 1000),
kNumWindows, GetTime());
- root_window()->DispatchTouchEvent(&move2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2);
target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000));
EXPECT_EQ("2", WindowIDAsString(target));
@@ -1821,11 +1821,11 @@
gfx::Point pos1(-10, -10);
TouchEvent press1(ui::ET_TOUCH_PRESSED, pos1, 0, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
gfx::Point pos2(1000, 1000);
TouchEvent press2(ui::ET_TOUCH_PRESSED, pos2, 1, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
// As these presses were outside the root window, they should be
// associated with the root window.
@@ -1845,11 +1845,11 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
delegate->Reset();
delegate->ReceivedAck();
@@ -1898,7 +1898,7 @@
delegate->Reset();
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1911,7 +1911,7 @@
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap.
EXPECT_FALSE(delegate->double_tap());
@@ -1925,10 +1925,10 @@
delegate->Reset();
TouchEvent move1(ui::ET_TOUCH_MOVED, gfx::Point(102, 202),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&move1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move1);
TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(131, 202),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&move2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1945,7 +1945,7 @@
kTouchId1, press1.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1962,7 +1962,7 @@
kTouchId2, press2.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -1986,12 +1986,12 @@
delegate->Reset();
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
// Send release event after sufficient delay so that two finger time expires.
delegate->Reset();
@@ -1999,7 +1999,7 @@
kTouchId1, press1.time_stamp() +
base::TimeDelta::FromMilliseconds(1000));
- root_window()->DispatchTouchEvent(&release1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release1);
EXPECT_FALSE(delegate->two_finger_tap());
// Lift second finger.
@@ -2010,7 +2010,7 @@
kTouchId2, press2.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release2);
EXPECT_FALSE(delegate->two_finger_tap());
}
@@ -2031,12 +2031,12 @@
delegate->Reset();
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
SendScrollEvent(root_window(), 130, 230, kTouchId1, delegate.get());
EXPECT_FALSE(delegate->two_finger_tap());
@@ -2049,7 +2049,7 @@
kTouchId2, press1.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->two_finger_tap());
EXPECT_TRUE(delegate->pinch_end());
}
@@ -2063,12 +2063,12 @@
delegate->Reset();
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
SendScrollEvent(root_window(), 101, 230, kTouchId2, delegate.get());
EXPECT_FALSE(delegate->two_finger_tap());
@@ -2081,7 +2081,7 @@
kTouchId1, press1.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->two_finger_tap());
EXPECT_TRUE(delegate->pinch_end());
}
@@ -2104,17 +2104,17 @@
delegate->Reset();
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
delegate->Reset();
TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&cancel);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel);
EXPECT_FALSE(delegate->two_finger_tap());
// Make sure there is enough delay before the touch is released so that it
@@ -2124,7 +2124,7 @@
kTouchId2, press1.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->two_finger_tap());
}
@@ -2137,17 +2137,17 @@
delegate->Reset();
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(130, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
delegate->Reset();
TouchEvent cancel(ui::ET_TOUCH_CANCELLED, gfx::Point(130, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&cancel);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&cancel);
EXPECT_FALSE(delegate->two_finger_tap());
// Make sure there is enough delay before the touch is released so that it
@@ -2157,7 +2157,7 @@
kTouchId1, press1.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->two_finger_tap());
}
}
@@ -2176,7 +2176,7 @@
delegate->Reset();
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_FALSE(delegate->double_tap());
@@ -2189,7 +2189,7 @@
delegate->Reset();
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(430, 201),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down()); // no touch down for second tap.
EXPECT_FALSE(delegate->double_tap());
@@ -2213,10 +2213,10 @@
const int kTouchId2 = 2;
TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10),
kTouchId1, GetTime());
- root_window()->DispatchTouchEvent(&press1);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press1);
TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20),
kTouchId2, GetTime());
- root_window()->DispatchTouchEvent(&press2);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
window->Hide();
EXPECT_EQ(NULL,
root_window()->gesture_recognizer()->GetTouchLockedTarget(&press1));
@@ -2244,7 +2244,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
// Scroll around, to cancel the long press
SendScrollEvent(root_window(), 130, 230, kTouchId, delegate.get());
@@ -2295,7 +2295,7 @@
delegate->Reset();
TouchEvent press(ui::ET_TOUCH_PRESSED, gfx::Point(101, 201),
kTouchId, GetTime());
- root_window()->DispatchTouchEvent(&press);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_FALSE(delegate->tap());
EXPECT_TRUE(delegate->tap_down());
EXPECT_TRUE(delegate->begin());
@@ -2364,7 +2364,7 @@
TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201),
kTouchId, press.time_stamp() +
base::TimeDelta::FromMilliseconds(50));
- root_window()->DispatchTouchEvent(&release);
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_FALSE(delegate->tap());
EXPECT_FALSE(delegate->tap_down());
EXPECT_FALSE(delegate->begin());
« no previous file with comments | « ui/aura/event_filter_unittest.cc ('k') | ui/aura/root_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698