| 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" |
| 11 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 12 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
| 13 #include "ash/test/launcher_test_api.h" | 13 #include "ash/test/shelf_test_api.h" |
| 14 #include "ash/wm/window_util.h" | 14 #include "ash/wm/window_util.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "ui/aura/root_window.h" | 17 #include "ui/aura/root_window.h" |
| 18 #include "ui/events/event.h" | 18 #include "ui/events/event.h" |
| 19 #include "ui/events/event_constants.h" | 19 #include "ui/events/event_constants.h" |
| 20 #include "ui/events/event_handler.h" | 20 #include "ui/events/event_handler.h" |
| 21 #include "ui/events/keycodes/keyboard_codes.h" | 21 #include "ui/events/keycodes/keyboard_codes.h" |
| 22 #include "ui/events/test/events_test_utils.h" | 22 #include "ui/events/test/events_test_utils.h" |
| 23 #include "ui/views/widget/widget.h" | 23 #include "ui/views/widget/widget.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 39 public: | 39 public: |
| 40 ShelfTooltipManagerTest() {} | 40 ShelfTooltipManagerTest() {} |
| 41 virtual ~ShelfTooltipManagerTest() {} | 41 virtual ~ShelfTooltipManagerTest() {} |
| 42 | 42 |
| 43 virtual void SetUp() OVERRIDE { | 43 virtual void SetUp() OVERRIDE { |
| 44 AshTestBase::SetUp(); | 44 AshTestBase::SetUp(); |
| 45 internal::RootWindowController* controller = | 45 internal::RootWindowController* controller = |
| 46 Shell::GetPrimaryRootWindowController(); | 46 Shell::GetPrimaryRootWindowController(); |
| 47 tooltip_manager_.reset(new internal::ShelfTooltipManager( | 47 tooltip_manager_.reset(new internal::ShelfTooltipManager( |
| 48 controller->GetShelfLayoutManager(), | 48 controller->GetShelfLayoutManager(), |
| 49 LauncherTestAPI(controller->shelf()->launcher()).shelf_view())); | 49 ShelfTestAPI(controller->shelf()->shelf()).shelf_view())); |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual void TearDown() OVERRIDE { | 52 virtual void TearDown() OVERRIDE { |
| 53 tooltip_manager_.reset(); | 53 tooltip_manager_.reset(); |
| 54 AshTestBase::TearDown(); | 54 AshTestBase::TearDown(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void ShowDelayed() { | 57 void ShowDelayed() { |
| 58 CreateWidget(); | 58 CreateWidget(); |
| 59 tooltip_manager_->ShowDelayed(dummy_anchor_.get(), base::string16()); | 59 tooltip_manager_->ShowDelayed(dummy_anchor_.get(), base::string16()); |
| (...skipping 217 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 |