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

Side by Side Diff: ash/launcher/launcher_tooltip_manager_unittest.cc

Issue 11570012: events: Update key-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-for-landing Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/tooltips/tooltip_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/launcher/launcher_tooltip_manager.h" 5 #include "ash/launcher/launcher_tooltip_manager.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/shelf_layout_manager.h" 10 #include "ash/wm/shelf_layout_manager.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 TEST_F(LauncherTooltipManagerTest, ShouldHideForEvents) { 149 TEST_F(LauncherTooltipManagerTest, ShouldHideForEvents) {
150 ShowImmediately(); 150 ShowImmediately();
151 ASSERT_TRUE(TooltipIsVisible()); 151 ASSERT_TRUE(TooltipIsVisible());
152 152
153 aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); 153 aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
154 ui::EventHandler* event_handler = GetEventHandler(); 154 ui::EventHandler* event_handler = GetEventHandler();
155 155
156 // Should not hide for key events. 156 // Should not hide for key events.
157 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); 157 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false);
158 SetEventTarget(root_window, &key_event); 158 SetEventTarget(root_window, &key_event);
159 EXPECT_EQ(ui::ER_UNHANDLED, 159 event_handler->OnKeyEvent(&key_event);
160 event_handler->OnKeyEvent(&key_event)); 160 EXPECT_FALSE(key_event.handled());
161 EXPECT_TRUE(TooltipIsVisible()); 161 EXPECT_TRUE(TooltipIsVisible());
162 162
163 // Should hide for touch events. 163 // Should hide for touch events.
164 ui::TouchEvent touch_event( 164 ui::TouchEvent touch_event(
165 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); 165 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta());
166 SetEventTarget(root_window, &touch_event); 166 SetEventTarget(root_window, &touch_event);
167 event_handler->OnTouchEvent(&touch_event); 167 event_handler->OnTouchEvent(&touch_event);
168 EXPECT_FALSE(touch_event.handled()); 168 EXPECT_FALSE(touch_event.handled());
169 EXPECT_FALSE(TooltipIsVisible()); 169 EXPECT_FALSE(TooltipIsVisible());
170 170
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // Should hide if the mouse is out of the tooltip. 211 // Should hide if the mouse is out of the tooltip.
212 test_api.set_location(tooltip_rect.origin() + gfx::Vector2d(-1, -1)); 212 test_api.set_location(tooltip_rect.origin() + gfx::Vector2d(-1, -1));
213 EXPECT_EQ(ui::ER_UNHANDLED, 213 EXPECT_EQ(ui::ER_UNHANDLED,
214 event_handler->OnMouseEvent(&mouse_event)); 214 event_handler->OnMouseEvent(&mouse_event));
215 RunAllPendingInMessageLoop(); 215 RunAllPendingInMessageLoop();
216 EXPECT_FALSE(TooltipIsVisible()); 216 EXPECT_FALSE(TooltipIsVisible());
217 } 217 }
218 218
219 } // namespace test 219 } // namespace test
220 } // namespace ash 220 } // namespace ash
OLDNEW
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/tooltips/tooltip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698