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

Unified Diff: ash/shelf/shelf_layout_manager_unittest.cc

Issue 1907363004: (Merge to M-51) Revise the shelf alignment locking mechanism. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/shelf/shelf_locking_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 05b662c085d07f4e4dec772c321e6428d6d3afed..1d5b911b8569dedeec86c753191d1c3e558e3b58 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -14,6 +14,7 @@
#include "ash/session/session_state_delegate.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_layout_manager_observer.h"
+#include "ash/shelf/shelf_locking_manager.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
@@ -380,10 +381,14 @@ class ShelfLayoutManagerTest : public ash::test::AshTestBase {
// Open the add user screen if |show| is true, otherwise end it.
void ShowAddUserScreen(bool show) {
SetUserAddingScreenRunning(show);
- ShelfLayoutManager* manager = GetShelfWidget()->shelf_layout_manager();
- manager->SessionStateChanged(
- show ? SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY :
- SessionStateDelegate::SESSION_STATE_ACTIVE);
+
+ const SessionStateDelegate::SessionState state =
+ show ? SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY
+ : SessionStateDelegate::SESSION_STATE_ACTIVE;
+ GetShelfWidget()->shelf_layout_manager()->SessionStateChanged(state);
+ test::ShelfTestAPI(GetShelfWidget()->shelf())
+ .shelf_locking_manager()
+ ->SessionStateChanged(state);
}
private:
@@ -763,7 +768,7 @@ TEST_F(ShelfLayoutManagerTest, SideAlignmentInteractionWithLockScreen) {
manager->SetAlignment(SHELF_ALIGNMENT_LEFT);
EXPECT_EQ(SHELF_ALIGNMENT_LEFT, manager->GetAlignment());
LockScreen();
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, manager->GetAlignment());
+ EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, manager->GetAlignment());
UnlockScreen();
EXPECT_EQ(SHELF_ALIGNMENT_LEFT, manager->GetAlignment());
}
@@ -774,7 +779,7 @@ TEST_F(ShelfLayoutManagerTest, SideAlignmentInteractionWithAddUserScreen) {
manager->SetAlignment(SHELF_ALIGNMENT_LEFT);
EXPECT_EQ(SHELF_ALIGNMENT_LEFT, manager->GetAlignment());
ShowAddUserScreen(true);
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, manager->GetAlignment());
+ EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, manager->GetAlignment());
ShowAddUserScreen(false);
EXPECT_EQ(SHELF_ALIGNMENT_LEFT, manager->GetAlignment());
}
« no previous file with comments | « ash/shelf/shelf_layout_manager.cc ('k') | ash/shelf/shelf_locking_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698