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

Unified Diff: trunk/src/ui/aura/root_window_unittest.cc

Issue 77203002: Revert 236048 "Rename RootWindowHost* to WindowTreeHost*" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 | « trunk/src/ui/aura/root_window_observer.h ('k') | trunk/src/ui/aura/test/event_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/aura/root_window_unittest.cc
===================================================================
--- trunk/src/ui/aura/root_window_unittest.cc (revision 236091)
+++ trunk/src/ui/aura/root_window_unittest.cc (working copy)
@@ -113,7 +113,7 @@
gfx::Point point(101, 201);
ui::MouseEvent event1(
ui::ET_MOUSE_PRESSED, point, point, ui::EF_LEFT_MOUSE_BUTTON);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&event1);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&event1);
// Event was tested for non-client area for the target window.
EXPECT_EQ(1, delegate1->non_client_count());
@@ -154,7 +154,7 @@
location,
location,
ui::EF_LEFT_MOUSE_BUTTON));
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get());
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get());
EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown());
// Additionally press the right.
@@ -163,7 +163,7 @@
location,
location,
ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON));
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get());
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get());
EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown());
// Release the left button.
@@ -172,7 +172,7 @@
location,
location,
ui::EF_RIGHT_MOUSE_BUTTON));
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get());
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get());
EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown());
// Release the right button. We should ignore the Shift-is-down flag.
@@ -181,7 +181,7 @@
location,
location,
ui::EF_SHIFT_DOWN));
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get());
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get());
EXPECT_FALSE(Env::GetInstance()->IsMouseButtonDown());
// Press the middle button.
@@ -190,7 +190,7 @@
location,
location,
ui::EF_MIDDLE_MOUSE_BUTTON));
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(event.get());
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(event.get());
EXPECT_TRUE(Env::GetInstance()->IsMouseButtonDown());
}
@@ -334,12 +334,12 @@
root_window()->SetEventFilter(filter); // passes ownership
ui::KeyEvent unknown_event(ui::ET_KEY_PRESSED, ui::VKEY_UNKNOWN, 0, false);
- EXPECT_FALSE(dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent(
+ EXPECT_FALSE(dispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent(
&unknown_event));
EXPECT_EQ(0, filter->num_key_events());
ui::KeyEvent known_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false);
- EXPECT_TRUE(dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent(
+ EXPECT_TRUE(dispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent(
&known_event));
EXPECT_EQ(1, filter->num_key_events());
}
@@ -352,7 +352,7 @@
test::TestEventHandler handler;
w1->AddPreTargetHandler(&handler);
ui::KeyEvent key_press(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false);
- EXPECT_TRUE(dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent(
+ EXPECT_TRUE(dispatcher()->AsRootWindowHostDelegate()->OnHostKeyEvent(
&key_press));
EXPECT_EQ(1, handler.num_key_events());
@@ -368,14 +368,14 @@
gfx::Point position = root_window()->bounds().origin();
position.Offset(-10, -10);
ui::TouchEvent press(ui::ET_TOUCH_PRESSED, position, 0, base::TimeDelta());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
EXPECT_EQ(1, filter->num_touch_events());
position = root_window()->bounds().origin();
position.Offset(root_window()->bounds().width() + 10,
root_window()->bounds().height() + 10);
ui::TouchEvent release(ui::ET_TOUCH_RELEASED, position, 0, base::TimeDelta());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
EXPECT_EQ(2, filter->num_touch_events());
}
@@ -397,7 +397,7 @@
0, -10,
0, -10,
2);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostScrollEvent(&scroll1);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostScrollEvent(&scroll1);
EXPECT_EQ(1, filter->num_scroll_events());
// Scroll event on a window should be dispatched properly.
@@ -408,7 +408,7 @@
-10, 0,
-10, 0,
2);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostScrollEvent(&scroll2);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostScrollEvent(&scroll2);
EXPECT_EQ(2, filter->num_scroll_events());
}
@@ -557,7 +557,7 @@
ui::MouseEvent mouse_move_event(ui::ET_MOUSE_MOVED, gfx::Point(0, 0),
gfx::Point(0, 0), 0);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_move_event);
// Discard MOUSE_ENTER.
filter->events().clear();
@@ -567,7 +567,7 @@
// Check that we don't immediately dispatch the MOUSE_DRAGGED event.
ui::MouseEvent mouse_dragged_event(ui::ET_MOUSE_DRAGGED, gfx::Point(0, 0),
gfx::Point(0, 0), 0);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_dragged_event);
EXPECT_TRUE(filter->events().empty());
@@ -575,7 +575,7 @@
// of event.
ui::MouseEvent mouse_pressed_event(ui::ET_MOUSE_PRESSED, gfx::Point(0, 0),
gfx::Point(0, 0), 0);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_pressed_event);
EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED",
EventTypesToString(filter->events()));
@@ -584,12 +584,12 @@
// Check that we coalesce held MOUSE_DRAGGED events.
ui::MouseEvent mouse_dragged_event2(ui::ET_MOUSE_DRAGGED, gfx::Point(1, 1),
gfx::Point(1, 1), 0);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_dragged_event);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_dragged_event2);
EXPECT_TRUE(filter->events().empty());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_pressed_event);
EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED",
EventTypesToString(filter->events()));
@@ -597,7 +597,7 @@
// Check that on ReleasePointerMoves, held events are not dispatched
// immediately, but posted instead.
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_dragged_event);
dispatcher()->ReleasePointerMoves();
EXPECT_TRUE(filter->events().empty());
@@ -609,10 +609,10 @@
// the Check that on ReleasePointerMoves, held events are not dispatched
// immediately, but posted instead.
dispatcher()->HoldPointerMoves();
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_dragged_event);
dispatcher()->ReleasePointerMoves();
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_pressed_event);
EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED",
EventTypesToString(filter->events()));
@@ -623,10 +623,10 @@
// Check that if the other message is another MOUSE_DRAGGED, we still coalesce
// them.
dispatcher()->HoldPointerMoves();
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_dragged_event);
dispatcher()->ReleasePointerMoves();
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
&mouse_dragged_event2);
EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events()));
filter->events().clear();
@@ -647,7 +647,7 @@
// test.
ui::TouchEvent touch_pressed_event(ui::ET_TOUCH_PRESSED, gfx::Point(0, 0),
0, base::TimeDelta());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(
&touch_pressed_event);
RunAllPendingInMessageLoop();
filter->events().clear();
@@ -657,13 +657,13 @@
// Check that we don't immediately dispatch the TOUCH_MOVED event.
ui::TouchEvent touch_moved_event(ui::ET_TOUCH_MOVED, gfx::Point(0, 0),
0, base::TimeDelta());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(
&touch_moved_event);
EXPECT_TRUE(filter->events().empty());
// Check that on ReleasePointerMoves, held events are not dispatched
// immediately, but posted instead.
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(
&touch_moved_event);
dispatcher()->ReleasePointerMoves();
EXPECT_TRUE(filter->events().empty());
@@ -677,9 +677,9 @@
0, base::TimeDelta());
filter->events().clear();
dispatcher()->HoldPointerMoves();
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(
&touch_moved_event);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(
+ dispatcher()->AsRootWindowHostDelegate()->OnHostTouchEvent(
&touch_released_event);
EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_END",
EventTypesToString(filter->events()));
@@ -706,20 +706,20 @@
// Dispatch a non-synthetic mouse event when mouse events are enabled.
ui::MouseEvent mouse1(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
gfx::Point(10, 10), 0);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse1);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse1);
EXPECT_FALSE(filter->events().empty());
filter->events().clear();
// Dispatch a synthetic mouse event when mouse events are enabled.
ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
gfx::Point(10, 10), ui::EF_IS_SYNTHESIZED);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse2);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse2);
EXPECT_FALSE(filter->events().empty());
filter->events().clear();
// Dispatch a synthetic mouse event when mouse events are disabled.
cursor_client.DisableMouseEvents();
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse2);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse2);
EXPECT_TRUE(filter->events().empty());
}
@@ -741,7 +741,7 @@
ui::MouseEvent mouse1(ui::ET_MOUSE_MOVED, mouse_location,
mouse_location, 0);
EXPECT_TRUE(filter->events().empty());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse1);
+ dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(&mouse1);
EXPECT_FALSE(filter->events().empty());
filter->events().clear();
@@ -1182,7 +1182,7 @@
} // namespace
#if defined(USE_OZONE)
-// Creating multiple WindowTreeHostOzone instances is broken.
+// Creating multiple RootWindowHostOzone instances is broken.
#define MAYBE_ValidRootDuringDestruction DISABLED_ValidRootDuringDestruction
#else
#define MAYBE_ValidRootDuringDestruction ValidRootDuringDestruction
@@ -1246,8 +1246,8 @@
TEST_F(RootWindowTest, DontResetHeldEvent) {
DontResetHeldEventWindowDelegate delegate(root_window());
scoped_ptr<Window> w1(CreateNormalWindow(1, root_window(), &delegate));
- WindowTreeHostDelegate* root_window_delegate =
- static_cast<WindowTreeHostDelegate*>(root_window()->GetDispatcher());
+ RootWindowHostDelegate* root_window_delegate =
+ static_cast<RootWindowHostDelegate*>(root_window()->GetDispatcher());
w1->SetBounds(gfx::Rect(0, 0, 40, 40));
ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED,
gfx::Point(10, 10), gfx::Point(10, 10),
@@ -1302,7 +1302,7 @@
} // namespace
#if defined(USE_OZONE)
-// Creating multiple WindowTreeHostOzone instances is broken.
+// Creating multiple RootWindowHostOzone instances is broken.
#define MAYBE_DeleteRootFromHeldMouseEvent DISABLED_DeleteRootFromHeldMouseEvent
#else
#define MAYBE_DeleteRootFromHeldMouseEvent DeleteRootFromHeldMouseEvent
« no previous file with comments | « trunk/src/ui/aura/root_window_observer.h ('k') | trunk/src/ui/aura/test/event_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698