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/system/overview/overview_button_tray.h" | 5 #include "ash/system/overview/overview_button_tray.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_types.h" | 9 #include "ash/shelf/shelf_types.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/system/status_area_widget.h" | 12 #include "ash/system/status_area_widget.h" |
| 13 #include "ash/system/user/login_status.h" |
13 #include "ash/test/ash_test_base.h" | 14 #include "ash/test/ash_test_base.h" |
14 #include "ash/wm/overview/window_selector_controller.h" | 15 #include "ash/wm/overview/window_selector_controller.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "ui/events/event.h" | 17 #include "ui/events/event.h" |
17 #include "ui/events/event_constants.h" | 18 #include "ui/events/event_constants.h" |
18 #include "ui/events/gestures/gesture_types.h" | 19 #include "ui/events/gestures/gesture_types.h" |
19 #include "ui/views/controls/image_view.h" | 20 #include "ui/views/controls/image_view.h" |
20 | 21 |
21 namespace ash { | 22 namespace ash { |
22 | 23 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 TEST_F(OverviewButtonTrayTest, SecondaryTrayCreatedVisible) { | 112 TEST_F(OverviewButtonTrayTest, SecondaryTrayCreatedVisible) { |
112 if (!SupportsMultipleDisplays()) | 113 if (!SupportsMultipleDisplays()) |
113 return; | 114 return; |
114 | 115 |
115 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); | 116 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); |
116 UpdateDisplay("400x400,200x200"); | 117 UpdateDisplay("400x400,200x200"); |
117 EXPECT_TRUE(GetSecondaryTray()->visible()); | 118 EXPECT_TRUE(GetSecondaryTray()->visible()); |
118 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); | 119 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); |
119 } | 120 } |
120 | 121 |
| 122 // Tests that the tray loses visibility when a user logs out, and that it |
| 123 // regains visibility when a user logs back in. |
| 124 TEST_F(OverviewButtonTrayTest, VisibilityChangesForLoginStatus) { |
| 125 Shell::GetInstance()->EnableMaximizeModeWindowManager(true); |
| 126 SetUserLoggedIn(false); |
| 127 Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_NONE); |
| 128 EXPECT_FALSE(GetTray()->visible()); |
| 129 SetUserLoggedIn(true); |
| 130 SetSessionStarted(true); |
| 131 Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_USER); |
| 132 EXPECT_TRUE(GetTray()->visible()); |
| 133 Shell::GetInstance()->EnableMaximizeModeWindowManager(false); |
| 134 } |
| 135 |
121 } // namespace ash | 136 } // namespace ash |
OLD | NEW |