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

Unified Diff: ui/views/corewm/compound_event_filter_unittest.cc

Issue 147203004: aura: Remove event-dispatch methods from WindowTreeHostDelegate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win Created 6 years, 11 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/views/corewm/capture_controller_unittest.cc ('k') | ui/views/corewm/input_method_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/compound_event_filter_unittest.cc
diff --git a/ui/views/corewm/compound_event_filter_unittest.cc b/ui/views/corewm/compound_event_filter_unittest.cc
index 38456803d971db58aa07f82a7cb310e31a695f21..4e2ea8d77b1dd6bf24002f8a9ee2722e6561bff9 100644
--- a/ui/views/corewm/compound_event_filter_unittest.cc
+++ b/ui/views/corewm/compound_event_filter_unittest.cc
@@ -65,36 +65,36 @@ TEST_F(CompoundEventFilterTest, CursorVisibilityChange) {
// Send key event to hide the cursor.
ui::KeyEvent key(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, true);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent(&key);
+ DispatchEventUsingWindowDispatcher(&key);
EXPECT_FALSE(cursor_client.IsCursorVisible());
// Synthesized mouse event should not show the cursor.
ui::MouseEvent enter(ui::ET_MOUSE_ENTERED, gfx::Point(10, 10),
gfx::Point(10, 10), 0, 0);
enter.set_flags(enter.flags() | ui::EF_IS_SYNTHESIZED);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&enter);
+ DispatchEventUsingWindowDispatcher(&enter);
EXPECT_FALSE(cursor_client.IsCursorVisible());
ui::MouseEvent move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
gfx::Point(10, 10), 0, 0);
move.set_flags(enter.flags() | ui::EF_IS_SYNTHESIZED);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&move);
+ DispatchEventUsingWindowDispatcher(&move);
EXPECT_FALSE(cursor_client.IsCursorVisible());
ui::MouseEvent real_move(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
gfx::Point(10, 10), 0, 0);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&real_move);
+ DispatchEventUsingWindowDispatcher(&real_move);
EXPECT_TRUE(cursor_client.IsCursorVisible());
// Send key event to hide the cursor again.
- dispatcher()->AsWindowTreeHostDelegate()->OnHostKeyEvent(&key);
+ DispatchEventUsingWindowDispatcher(&key);
EXPECT_FALSE(cursor_client.IsCursorVisible());
// Mouse synthesized exit event should not show the cursor.
ui::MouseEvent exit(ui::ET_MOUSE_EXITED, gfx::Point(10, 10),
gfx::Point(10, 10), 0, 0);
exit.set_flags(enter.flags() | ui::EF_IS_SYNTHESIZED);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&exit);
+ DispatchEventUsingWindowDispatcher(&exit);
EXPECT_FALSE(cursor_client.IsCursorVisible());
aura::Env::GetInstance()->RemovePreTargetHandler(compound_filter.get());
}
@@ -114,29 +114,29 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
ui::MouseEvent mouse0(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
gfx::Point(10, 10), 0, 0);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse0);
+ DispatchEventUsingWindowDispatcher(&mouse0);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
// This press is required for the GestureRecognizer to associate a target
// with kTouchId
ui::TouchEvent press0(
ui::ET_TOUCH_PRESSED, gfx::Point(90, 90), 1, GetTime());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press0);
+ DispatchEventUsingWindowDispatcher(&press0);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
ui::TouchEvent move(ui::ET_TOUCH_MOVED, gfx::Point(10, 10), 1, GetTime());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move);
+ DispatchEventUsingWindowDispatcher(&move);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
ui::TouchEvent release(
ui::ET_TOUCH_RELEASED, gfx::Point(10, 10), 1, GetTime());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release);
+ DispatchEventUsingWindowDispatcher(&release);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
ui::MouseEvent mouse1(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
gfx::Point(10, 10), 0, 0);
// Move the cursor again. The cursor should be visible.
- dispatcher()->AsWindowTreeHostDelegate()->OnHostMouseEvent(&mouse1);
+ DispatchEventUsingWindowDispatcher(&mouse1);
EXPECT_TRUE(cursor_client.IsMouseEventsEnabled());
// Now activate the window and press on it again.
@@ -144,7 +144,7 @@ TEST_F(CompoundEventFilterTest, TouchHidesCursor) {
ui::ET_TOUCH_PRESSED, gfx::Point(90, 90), 1, GetTime());
aura::client::GetActivationClient(
root_window())->ActivateWindow(window.get());
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1);
+ DispatchEventUsingWindowDispatcher(&press1);
EXPECT_FALSE(cursor_client.IsMouseEventsEnabled());
aura::Env::GetInstance()->RemovePreTargetHandler(compound_filter.get());
}
« no previous file with comments | « ui/views/corewm/capture_controller_unittest.cc ('k') | ui/views/corewm/input_method_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698