| 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/shelf/shelf_layout_manager.h" | 7 #include "ash/shelf/shelf_layout_manager.h" |
| 8 #include "ash/shelf/shelf_widget.h" | 8 #include "ash/shelf/shelf_widget.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 views::Widget* dummy = new views::Widget; | 115 views::Widget* dummy = new views::Widget; |
| 116 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 116 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
| 117 params.bounds = gfx::Rect(0, 0, 200, 200); | 117 params.bounds = gfx::Rect(0, 0, 200, 200); |
| 118 params.context = CurrentContext(); | 118 params.context = CurrentContext(); |
| 119 dummy->Init(params); | 119 dummy->Init(params); |
| 120 dummy->Show(); | 120 dummy->Show(); |
| 121 | 121 |
| 122 ShowImmediately(); | 122 ShowImmediately(); |
| 123 ASSERT_TRUE(TooltipIsVisible()); | 123 ASSERT_TRUE(TooltipIsVisible()); |
| 124 | 124 |
| 125 ShelfLayoutManager* shelf_layout_manager = shelf_->shelf_layout_manager(); | 125 shelf_->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 126 shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 126 shelf_->shelf_layout_manager()->UpdateAutoHideState(); |
| 127 shelf_layout_manager->UpdateAutoHideState(); | 127 ASSERT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_->GetAutoHideState()); |
| 128 ASSERT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_layout_manager->auto_hide_state()); | |
| 129 | 128 |
| 130 // Tooltip visibility change for auto hide may take time. | 129 // Tooltip visibility change for auto hide may take time. |
| 131 EXPECT_TRUE(TooltipIsVisible()); | 130 EXPECT_TRUE(TooltipIsVisible()); |
| 132 RunAllPendingInMessageLoop(); | 131 RunAllPendingInMessageLoop(); |
| 133 EXPECT_FALSE(TooltipIsVisible()); | 132 EXPECT_FALSE(TooltipIsVisible()); |
| 134 | 133 |
| 135 // Do not show the view if the shelf is hidden. | 134 // Do not show the view if the shelf is hidden. |
| 136 ShowImmediately(); | 135 ShowImmediately(); |
| 137 EXPECT_FALSE(TooltipIsVisible()); | 136 EXPECT_FALSE(TooltipIsVisible()); |
| 138 | 137 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 206 |
| 208 // Should not hide for key events. | 207 // Should not hide for key events. |
| 209 ShowImmediately(); | 208 ShowImmediately(); |
| 210 ASSERT_TRUE(TooltipIsVisible()); | 209 ASSERT_TRUE(TooltipIsVisible()); |
| 211 generator.PressKey(ui::VKEY_A, ui::EF_NONE); | 210 generator.PressKey(ui::VKEY_A, ui::EF_NONE); |
| 212 EXPECT_TRUE(TooltipIsVisible()); | 211 EXPECT_TRUE(TooltipIsVisible()); |
| 213 } | 212 } |
| 214 | 213 |
| 215 } // namespace test | 214 } // namespace test |
| 216 } // namespace ash | 215 } // namespace ash |
| OLD | NEW |