Index: ash/shelf/shelf_layout_manager_unittest.cc |
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc |
index 64983c19691a07821ed187dd228b45f5d3e0ae0d..b2f649c5f0befb4eaf061ea6808a8e3a6c6fe2da 100644 |
--- a/ash/shelf/shelf_layout_manager_unittest.cc |
+++ b/ash/shelf/shelf_layout_manager_unittest.cc |
@@ -1549,7 +1549,13 @@ TEST_F(ShelfLayoutManagerTest, WorkAreaChangeWorkspace) { |
} |
TEST_F(ShelfLayoutManagerTest, BackgroundTypeWhenLockingScreen) { |
- EXPECT_NE(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
xiyuan
2017/03/17 07:08:15
New test setup using TestSessionControllerClient f
|
+ // Creates a maximized window to have a background type other than default. |
+ std::unique_ptr<aura::Window> w1(CreateTestWindow()); |
James Cook
2017/03/17 17:14:36
super nit: how about |window| instead of |w1|?
xiyuan
2017/03/17 22:52:03
Done.
|
+ w1->Show(); |
+ wm::ActivateWindow(w1.get()); |
+ EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
+ w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); |
+ EXPECT_EQ(SHELF_BACKGROUND_MAXIMIZED, GetShelfWidget()->GetBackgroundType()); |
Shell::GetInstance() |
->lock_state_controller() |
@@ -1558,12 +1564,6 @@ TEST_F(ShelfLayoutManagerTest, BackgroundTypeWhenLockingScreen) { |
} |
TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColor) { |
- // TODO(bruthig|xiyuan): Move SessionState setup into AshTestBase or |
- // AshTestHelper. |
- mojom::SessionInfoPtr info = mojom::SessionInfo::New(); |
- info->state = session_manager::SessionState::ACTIVE; |
- ash::WmShell::Get()->session_controller()->SetSessionInfo(std::move(info)); |
- |
EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
std::unique_ptr<aura::Window> w1(CreateTestWindow()); |
@@ -1596,12 +1596,6 @@ TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColor) { |
// Verify that the shelf doesn't have the opaque background if it's auto-hide |
// status. |
TEST_F(ShelfLayoutManagerTest, ShelfBackgroundColorAutoHide) { |
- // TODO(bruthig|xiyuan): Move SessionState setup into AshTestBase or |
- // AshTestHelper. |
- mojom::SessionInfoPtr info = mojom::SessionInfo::New(); |
- info->state = session_manager::SessionState::ACTIVE; |
- ash::WmShell::Get()->session_controller()->SetSessionInfo(std::move(info)); |
- |
EXPECT_EQ(SHELF_BACKGROUND_DEFAULT, GetShelfWidget()->GetBackgroundType()); |
GetPrimaryShelf()->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |