| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/common/system/overview/overview_button_tray.h" | 5 #include "ash/common/system/overview/overview_button_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 8 #include "ash/common/system/status_area_widget.h" | 8 #include "ash/common/system/status_area_widget.h" |
| 9 #include "ash/common/test/test_session_state_delegate.h" | 9 #include "ash/common/test/test_session_state_delegate.h" |
| 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 NotifySessionStateChanged(); | 188 NotifySessionStateChanged(); |
| 189 EXPECT_TRUE(GetTray()->visible()); | 189 EXPECT_TRUE(GetTray()->visible()); |
| 190 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 190 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 191 false); | 191 false); |
| 192 } | 192 } |
| 193 | 193 |
| 194 // Tests that the tray only renders as active while selection is ongoing. Any | 194 // Tests that the tray only renders as active while selection is ongoing. Any |
| 195 // dismissal of overview mode clears the active state. | 195 // dismissal of overview mode clears the active state. |
| 196 TEST_F(OverviewButtonTrayTest, ActiveStateOnlyDuringOverviewMode) { | 196 TEST_F(OverviewButtonTrayTest, ActiveStateOnlyDuringOverviewMode) { |
| 197 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); | 197 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); |
| 198 ASSERT_FALSE(GetTray()->draw_background_as_active()); | 198 ASSERT_FALSE(GetTray()->is_active()); |
| 199 | 199 |
| 200 // Overview Mode only works when there is a window | 200 // Overview Mode only works when there is a window |
| 201 std::unique_ptr<aura::Window> window( | 201 std::unique_ptr<aura::Window> window( |
| 202 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); | 202 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); |
| 203 ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), | 203 |
| 204 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 204 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->ToggleOverview()); |
| 205 GetTray()->PerformAction(tap); | |
| 206 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->IsSelecting()); | 205 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->IsSelecting()); |
| 207 EXPECT_TRUE(GetTray()->draw_background_as_active()); | 206 EXPECT_TRUE(GetTray()->is_active()); |
| 208 | 207 |
| 209 WmShell::Get()->window_selector_controller()->OnSelectionEnded(); | 208 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->ToggleOverview()); |
| 210 EXPECT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); | 209 EXPECT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); |
| 211 EXPECT_FALSE(GetTray()->draw_background_as_active()); | 210 EXPECT_FALSE(GetTray()->is_active()); |
| 212 } | 211 } |
| 213 | 212 |
| 214 // Test that when a hide animation is aborted via deletion, that the | 213 // Test that when a hide animation is aborted via deletion, that the |
| 215 // OverviewButton is still hidden. | 214 // OverviewButton is still hidden. |
| 216 #if defined(OS_WIN) && !defined(USE_ASH) | 215 #if defined(OS_WIN) && !defined(USE_ASH) |
| 217 // TODO(msw): Broken on Windows. http://crbug.com/584038 | 216 // TODO(msw): Broken on Windows. http://crbug.com/584038 |
| 218 #define MAYBE_HideAnimationAlwaysCompletes DISABLED_HideAnimationAlwaysCompletes | 217 #define MAYBE_HideAnimationAlwaysCompletes DISABLED_HideAnimationAlwaysCompletes |
| 219 #else | 218 #else |
| 220 #define MAYBE_HideAnimationAlwaysCompletes HideAnimationAlwaysCompletes | 219 #define MAYBE_HideAnimationAlwaysCompletes HideAnimationAlwaysCompletes |
| 221 #endif | 220 #endif |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); | 257 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); |
| 259 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 258 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 260 true); | 259 true); |
| 261 EXPECT_TRUE(GetTray()->visible()); | 260 EXPECT_TRUE(GetTray()->visible()); |
| 262 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 261 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 263 false); | 262 false); |
| 264 EXPECT_FALSE(GetTray()->visible()); | 263 EXPECT_FALSE(GetTray()->visible()); |
| 265 } | 264 } |
| 266 | 265 |
| 267 } // namespace ash | 266 } // namespace ash |
| OLD | NEW |