Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: ash/system/overview/overview_button_tray_unittest.cc

Issue 1149833006: Stop the OverviewButton from appearing on the Add-User screen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Decouple Overview Visibility from WindowSelector activation Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« ash/system/overview/overview_button_tray.cc ('K') | « ash/system/overview/overview_button_tray.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698