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

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

Issue 11592011: events: Update mouse-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/launcher/launcher_tooltip_manager.cc ('k') | ash/magnifier/magnification_controller.cc » ('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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 gfx::Rect tooltip_rect = GetTooltipWidget()->GetNativeWindow()->bounds(); 198 gfx::Rect tooltip_rect = GetTooltipWidget()->GetNativeWindow()->bounds();
199 ASSERT_FALSE(tooltip_rect.IsEmpty()); 199 ASSERT_FALSE(tooltip_rect.IsEmpty());
200 200
201 // Shouldn't hide if the mouse is in the tooltip. 201 // Shouldn't hide if the mouse is in the tooltip.
202 ui::MouseEvent mouse_event(ui::ET_MOUSE_MOVED, tooltip_rect.CenterPoint(), 202 ui::MouseEvent mouse_event(ui::ET_MOUSE_MOVED, tooltip_rect.CenterPoint(),
203 tooltip_rect.CenterPoint(), ui::EF_NONE); 203 tooltip_rect.CenterPoint(), ui::EF_NONE);
204 ui::LocatedEvent::TestApi test_api(&mouse_event); 204 ui::LocatedEvent::TestApi test_api(&mouse_event);
205 205
206 SetEventTarget(root_window, &mouse_event); 206 SetEventTarget(root_window, &mouse_event);
207 EXPECT_EQ(ui::ER_UNHANDLED, 207 event_handler->OnMouseEvent(&mouse_event);
208 event_handler->OnMouseEvent(&mouse_event)); 208 EXPECT_FALSE(mouse_event.handled());
209 EXPECT_TRUE(TooltipIsVisible()); 209 EXPECT_TRUE(TooltipIsVisible());
210 210
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 event_handler->OnMouseEvent(&mouse_event);
214 event_handler->OnMouseEvent(&mouse_event)); 214 EXPECT_FALSE(mouse_event.handled());
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/launcher/launcher_tooltip_manager.cc ('k') | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698