Index: ash/system/overview/overview_button_tray_unittest.cc |
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc |
index a7e6a3e17fe4ba9c87a6e654e576fc0b7ae8eff2..702f31de80da829705c3b9d4985b1032a86afc78 100644 |
--- a/ash/system/overview/overview_button_tray_unittest.cc |
+++ b/ash/system/overview/overview_button_tray_unittest.cc |
@@ -14,7 +14,9 @@ |
#include "ash/system/status_area_widget.h" |
#include "ash/system/user/login_status.h" |
#include "ash/test/ash_test_base.h" |
+#include "ash/test/ash_test_helper.h" |
#include "ash/test/status_area_widget_test_helper.h" |
+#include "ash/test/test_session_state_delegate.h" |
#include "ash/wm/maximize_mode/maximize_mode_controller.h" |
#include "ash/wm/overview/window_selector_controller.h" |
#include "base/command_line.h" |
@@ -51,6 +53,8 @@ class OverviewButtonTrayTest : public test::AshTestBase { |
void SetUp() override; |
+ void UpdateSessionsState(); |
+ |
protected: |
views::ImageView* GetImageView(OverviewButtonTray* tray) { |
return tray->icon_; |
@@ -68,6 +72,11 @@ void OverviewButtonTrayTest::SetUp() { |
AshTestBase::SetUp(); |
} |
+void OverviewButtonTrayTest::UpdateSessionsState() { |
+ GetTray()->SessionStateChanged( |
+ ash_test_helper()->GetTestSessionStateDelegate()->GetSessionState()); |
+} |
+ |
// Ensures that creation doesn't cause any crashes and adds the image icon. |
TEST_F(OverviewButtonTrayTest, BasicConstruction) { |
EXPECT_TRUE(GetImageView(GetTray()) != NULL); |
@@ -178,6 +187,12 @@ TEST_F(OverviewButtonTrayTest, VisibilityChangesForLoginStatus) { |
SetSessionStarted(true); |
Shell::GetInstance()->UpdateAfterLoginStatusChange(user::LOGGED_IN_USER); |
EXPECT_TRUE(GetTray()->visible()); |
+ SetUserAddingScreenRunning(true); |
+ UpdateSessionsState(); |
+ EXPECT_FALSE(GetTray()->visible()); |
+ SetUserAddingScreenRunning(false); |
+ UpdateSessionsState(); |
+ EXPECT_TRUE(GetTray()->visible()); |
Shell::GetInstance()->maximize_mode_controller()-> |
EnableMaximizeModeWindowManager(false); |
} |