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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 2734933004: ash: Use SessionController instead of SessionStateDelegate (Closed)
Patch Set: rebase Created 3 years, 9 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/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);

Powered by Google App Engine
This is Rietveld 408576698