| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf_tooltip_manager.h" | 5 #include "ash/shelf/shelf_tooltip_manager.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shelf/shelf_widget.h" | 9 #include "ash/shelf/shelf_widget.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 176 } |
| 177 | 177 |
| 178 TEST_F(ShelfTooltipManagerTest, ShouldHideForEvents) { | 178 TEST_F(ShelfTooltipManagerTest, ShouldHideForEvents) { |
| 179 ShowImmediately(); | 179 ShowImmediately(); |
| 180 ASSERT_TRUE(TooltipIsVisible()); | 180 ASSERT_TRUE(TooltipIsVisible()); |
| 181 | 181 |
| 182 aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); | 182 aura::Window* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); |
| 183 ui::EventHandler* event_handler = GetEventHandler(); | 183 ui::EventHandler* event_handler = GetEventHandler(); |
| 184 | 184 |
| 185 // Should not hide for key events. | 185 // Should not hide for key events. |
| 186 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); | 186 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE); |
| 187 SetEventTarget(root_window, &key_event); | 187 SetEventTarget(root_window, &key_event); |
| 188 event_handler->OnKeyEvent(&key_event); | 188 event_handler->OnKeyEvent(&key_event); |
| 189 EXPECT_FALSE(key_event.handled()); | 189 EXPECT_FALSE(key_event.handled()); |
| 190 EXPECT_TRUE(TooltipIsVisible()); | 190 EXPECT_TRUE(TooltipIsVisible()); |
| 191 | 191 |
| 192 // Should hide for touch events. | 192 // Should hide for touch events. |
| 193 ui::TouchEvent touch_event( | 193 ui::TouchEvent touch_event( |
| 194 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); | 194 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); |
| 195 SetEventTarget(root_window, &touch_event); | 195 SetEventTarget(root_window, &touch_event); |
| 196 event_handler->OnTouchEvent(&touch_event); | 196 event_handler->OnTouchEvent(&touch_event); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 277 |
| 278 SetEventTarget(root_window, &mouse_event); | 278 SetEventTarget(root_window, &mouse_event); |
| 279 event_handler->OnMouseEvent(&mouse_event); | 279 event_handler->OnMouseEvent(&mouse_event); |
| 280 EXPECT_FALSE(mouse_event.handled()); | 280 EXPECT_FALSE(mouse_event.handled()); |
| 281 RunAllPendingInMessageLoop(); | 281 RunAllPendingInMessageLoop(); |
| 282 EXPECT_FALSE(TooltipIsVisible()); | 282 EXPECT_FALSE(TooltipIsVisible()); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace test | 285 } // namespace test |
| 286 } // namespace ash | 286 } // namespace ash |
| OLD | NEW |