| Index: trunk/src/ui/aura/window_unittest.cc
|
| ===================================================================
|
| --- trunk/src/ui/aura/window_unittest.cc (revision 236091)
|
| +++ trunk/src/ui/aura/window_unittest.cc (working copy)
|
| @@ -488,13 +488,13 @@
|
|
|
| ui::TouchEvent pressed(
|
| ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&pressed);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&pressed);
|
| EXPECT_TRUE(w1.HitTest(gfx::Point(-2, -2)));
|
| EXPECT_TRUE(w1.HitTest(gfx::Point(-5, -5)));
|
| EXPECT_FALSE(w1.HitTest(gfx::Point(-5, -6)));
|
| ui::TouchEvent released(
|
| ui::ET_TOUCH_RELEASED, gfx::Point(50, 50), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&released);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&released);
|
| EXPECT_FALSE(w1.HitTest(gfx::Point(-2, -2)));
|
|
|
| // TODO(beng): clip Window to parent.
|
| @@ -845,7 +845,7 @@
|
|
|
| ui::TouchEvent touchev(
|
| ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&touchev);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev);
|
| EXPECT_EQ(1, delegate.touch_event_count());
|
| delegate.ResetCounts();
|
|
|
| @@ -861,7 +861,7 @@
|
|
|
| ui::TouchEvent touchev2(
|
| ui::ET_TOUCH_PRESSED, gfx::Point(250, 250), 1, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&touchev2);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&touchev2);
|
| EXPECT_EQ(0, delegate.touch_event_count());
|
|
|
| // Removing the capture window from parent should reset the capture window
|
| @@ -884,7 +884,7 @@
|
| // Press on w1.
|
| ui::TouchEvent press(
|
| ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
|
| // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
| EXPECT_EQ(2, delegate1.gesture_event_count());
|
| delegate1.ResetCounts();
|
| @@ -898,7 +898,7 @@
|
|
|
| // Events now go to w2.
|
| ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
|
| EXPECT_EQ(0, delegate1.gesture_event_count());
|
| EXPECT_EQ(0, delegate1.touch_event_count());
|
| EXPECT_EQ(0, delegate2.gesture_event_count());
|
| @@ -906,14 +906,14 @@
|
|
|
| ui::TouchEvent release(
|
| ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
|
| EXPECT_EQ(0, delegate1.gesture_event_count());
|
| EXPECT_EQ(0, delegate2.gesture_event_count());
|
|
|
| // A new press is captured by w2.
|
| ui::TouchEvent press2(
|
| ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press2);
|
| EXPECT_EQ(0, delegate1.gesture_event_count());
|
| // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
| EXPECT_EQ(2, delegate2.gesture_event_count());
|
| @@ -935,7 +935,7 @@
|
|
|
| ui::TouchEvent press(
|
| ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
|
|
|
| // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
| EXPECT_EQ(2, delegate.gesture_event_count());
|
| @@ -950,7 +950,7 @@
|
| // On move We will get TOUCH_MOVED, GESTURE_TAP_CANCEL,
|
| // GESTURE_SCROLL_START and GESTURE_SCROLL_UPDATE.
|
| ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 20), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move);
|
| EXPECT_EQ(1, delegate.touch_event_count());
|
| EXPECT_EQ(3, delegate.gesture_event_count());
|
| delegate.ResetCounts();
|
| @@ -963,7 +963,7 @@
|
|
|
| // On move we still get TOUCH_MOVED and GESTURE_SCROLL_UPDATE.
|
| ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(10, 30), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move2);
|
| EXPECT_EQ(1, delegate.touch_event_count());
|
| EXPECT_EQ(1, delegate.gesture_event_count());
|
| delegate.ResetCounts();
|
| @@ -971,7 +971,7 @@
|
| // And on release we get TOUCH_RELEASED, GESTURE_SCROLL_END, GESTURE_END
|
| ui::TouchEvent release(
|
| ui::ET_TOUCH_RELEASED, gfx::Point(10, 20), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
|
| EXPECT_EQ(1, delegate.touch_event_count());
|
| EXPECT_EQ(2, delegate.gesture_event_count());
|
| }
|
| @@ -984,7 +984,7 @@
|
| scoped_ptr<Window> w1(CreateTestWindowWithDelegate(
|
| &d1, 0, gfx::Rect(0, 0, 20, 20), root_window()));
|
| ui::TouchEvent p1(ui::ET_TOUCH_PRESSED, gfx::Point(10, 10), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&p1);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&p1);
|
| // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN.
|
| EXPECT_EQ(1, d1.touch_event_count());
|
| EXPECT_EQ(2, d1.gesture_event_count());
|
| @@ -995,7 +995,7 @@
|
| scoped_ptr<Window> w2(CreateTestWindowWithDelegate(
|
| &d2, 0, gfx::Rect(40, 0, 40, 20), root_window()));
|
| ui::TouchEvent p2(ui::ET_TOUCH_PRESSED, gfx::Point(41, 10), 1, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&p2);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&p2);
|
| EXPECT_EQ(0, d1.touch_event_count());
|
| EXPECT_EQ(0, d1.gesture_event_count());
|
| // We will get both GESTURE_BEGIN and GESTURE_TAP_DOWN for new target window.
|
| @@ -1031,7 +1031,7 @@
|
| // Move touch id originally associated with |w2|. Since capture was transfered
|
| // from 2 to 3 only |w3| should get the event.
|
| ui::TouchEvent m3(ui::ET_TOUCH_MOVED, gfx::Point(110, 105), 1, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&m3);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&m3);
|
| EXPECT_EQ(0, d1.touch_event_count());
|
| EXPECT_EQ(0, d1.gesture_event_count());
|
| EXPECT_EQ(0, d2.touch_event_count());
|
| @@ -1054,7 +1054,7 @@
|
|
|
| // And when we move the touch again, |w3| still gets the events.
|
| ui::TouchEvent m4(ui::ET_TOUCH_MOVED, gfx::Point(120, 105), 1, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&m4);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&m4);
|
| EXPECT_EQ(0, d1.touch_event_count());
|
| EXPECT_EQ(0, d1.gesture_event_count());
|
| EXPECT_EQ(0, d2.touch_event_count());
|
| @@ -1205,7 +1205,7 @@
|
| }
|
|
|
| // Verifies that the WindowDelegate receives MouseExit from ET_MOUSE_EXITED.
|
| -TEST_F(WindowTest, WindowTreeHostExit) {
|
| +TEST_F(WindowTest, RootWindowHostExit) {
|
| MouseEnterExitWindowDelegate d1;
|
| scoped_ptr<Window> w1(
|
| CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50),
|
| @@ -1219,7 +1219,7 @@
|
|
|
| ui::MouseEvent exit_event(
|
| ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), 0);
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&exit_event);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&exit_event);
|
| EXPECT_FALSE(d1.entered());
|
| EXPECT_TRUE(d1.exited());
|
| }
|
| @@ -1576,7 +1576,7 @@
|
|
|
| ui::TouchEvent press(
|
| ui::ET_TOUCH_PRESSED, gfx::Point(size.height() - 10, 10), 0, getTime());
|
| - dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press);
|
| + dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
|
| EXPECT_EQ(gfx::Point(10, 10).ToString(), delegate->position().ToString());
|
| }
|
|
|
|
|