Chromium Code Reviews| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 std::unique_ptr<aura::Window> window( | 104 std::unique_ptr<aura::Window> window( |
| 105 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); | 105 CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); |
| 106 ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), | 106 ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), |
| 107 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 107 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 108 GetTray()->PerformAction(tap); | 108 GetTray()->PerformAction(tap); |
| 109 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->IsSelecting()); | 109 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->IsSelecting()); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Tests that tapping on the control will record the user action Tray_Overview. | 112 // Tests that tapping on the control will record the user action Tray_Overview. |
| 113 TEST_F(OverviewButtonTrayTest, TrayOverviewUserAction) { | 113 TEST_F(OverviewButtonTrayTest, TrayOverviewUserAction) { |
| 114 // TODO: investigate failure in mash, http://crbug.com/696754. | |
|
msw
2017/03/03 01:08:10
q: Is this bug applicable to this failure too? (th
sky
2017/03/03 03:51:04
Indeed you are right. I filed a new bug for this.
| |
| 115 if (WmShell::Get()->IsRunningInMash()) | |
| 116 return; | |
| 117 | |
| 114 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); | 118 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); |
| 115 | 119 |
| 116 // Tapping on the control when there are no windows (and thus the user cannot | 120 // Tapping on the control when there are no windows (and thus the user cannot |
| 117 // enter overview mode) should still record the action. | 121 // enter overview mode) should still record the action. |
| 118 base::UserActionTester user_action_tester; | 122 base::UserActionTester user_action_tester; |
| 119 ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), | 123 ui::GestureEvent tap(0, 0, 0, base::TimeTicks(), |
| 120 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); | 124 ui::GestureEventDetails(ui::ET_GESTURE_TAP)); |
| 121 GetTray()->PerformAction(tap); | 125 GetTray()->PerformAction(tap); |
| 122 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); | 126 ASSERT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); |
| 123 EXPECT_EQ(1, user_action_tester.GetActionCount(kTrayOverview)); | 127 EXPECT_EQ(1, user_action_tester.GetActionCount(kTrayOverview)); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 EXPECT_TRUE(GetTray()->is_active()); | 204 EXPECT_TRUE(GetTray()->is_active()); |
| 201 | 205 |
| 202 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->ToggleOverview()); | 206 EXPECT_TRUE(WmShell::Get()->window_selector_controller()->ToggleOverview()); |
| 203 EXPECT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); | 207 EXPECT_FALSE(WmShell::Get()->window_selector_controller()->IsSelecting()); |
| 204 EXPECT_FALSE(GetTray()->is_active()); | 208 EXPECT_FALSE(GetTray()->is_active()); |
| 205 } | 209 } |
| 206 | 210 |
| 207 // Test that when a hide animation is aborted via deletion, that the | 211 // Test that when a hide animation is aborted via deletion, that the |
| 208 // OverviewButton is still hidden. | 212 // OverviewButton is still hidden. |
| 209 TEST_F(OverviewButtonTrayTest, HideAnimationAlwaysCompletes) { | 213 TEST_F(OverviewButtonTrayTest, HideAnimationAlwaysCompletes) { |
| 214 // TODO: disabled as ScreenRotationAnimator does not work in mash, | |
| 215 // http://crbug.com/696754. | |
| 216 if (WmShell::Get()->IsRunningInMash()) | |
| 217 return; | |
| 218 | |
| 210 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 219 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 211 true); | 220 true); |
| 212 | 221 |
| 213 // Long duration for hide animation, to allow it to be interrupted. | 222 // Long duration for hide animation, to allow it to be interrupted. |
| 214 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> hide_duration( | 223 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> hide_duration( |
| 215 new ui::ScopedAnimationDurationScaleMode( | 224 new ui::ScopedAnimationDurationScaleMode( |
| 216 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION)); | 225 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION)); |
| 217 GetTray()->SetVisible(false); | 226 GetTray()->SetVisible(false); |
| 218 | 227 |
| 219 // ScreenRotationAnimator copies the current layers, and deletes them upon | 228 // ScreenRotationAnimator copies the current layers, and deletes them upon |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 245 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); | 254 ASSERT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); |
| 246 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 255 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 247 true); | 256 true); |
| 248 EXPECT_TRUE(GetTray()->visible()); | 257 EXPECT_TRUE(GetTray()->visible()); |
| 249 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( | 258 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 250 false); | 259 false); |
| 251 EXPECT_FALSE(GetTray()->visible()); | 260 EXPECT_FALSE(GetTray()->visible()); |
| 252 } | 261 } |
| 253 | 262 |
| 254 } // namespace ash | 263 } // namespace ash |
| OLD | NEW |