| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |