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

Unified Diff: ash/common/shelf/shelf_locking_manager_unittest.cc

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 10 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/common/shelf/shelf_locking_manager.cc ('k') | ash/common/shelf/shelf_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_locking_manager_unittest.cc
diff --git a/ash/common/shelf/shelf_locking_manager_unittest.cc b/ash/common/shelf/shelf_locking_manager_unittest.cc
deleted file mode 100644
index d225a9376eae39c14849cc85705e5071f4abc10a..0000000000000000000000000000000000000000
--- a/ash/common/shelf/shelf_locking_manager_unittest.cc
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/shelf/shelf_locking_manager.h"
-
-#include "ash/common/session/session_state_delegate.h"
-#include "ash/common/shelf/wm_shelf.h"
-#include "ash/test/ash_test_base.h"
-
-namespace ash {
-namespace test {
-
-// Tests the shelf behavior when the screen or session is locked.
-class ShelfLockingManagerTest : public ash::test::AshTestBase {
- public:
- ShelfLockingManagerTest() {}
-
- ShelfLockingManager* GetShelfLockingManager() {
- return GetPrimaryShelf()->GetShelfLockingManagerForTesting();
- }
-
- void SetScreenLocked(bool locked) {
- GetShelfLockingManager()->OnLockStateChanged(locked);
- }
-
- void SetSessionState(session_manager::SessionState state) {
- GetShelfLockingManager()->SessionStateChanged(state);
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShelfLockingManagerTest);
-};
-
-// Makes sure shelf alignment is correct for lock screen.
-TEST_F(ShelfLockingManagerTest, AlignmentLockedWhileScreenLocked) {
- WmShelf* shelf = GetPrimaryShelf();
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->GetAlignment());
-
- shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
- EXPECT_EQ(SHELF_ALIGNMENT_LEFT, shelf->GetAlignment());
-
- SetScreenLocked(true);
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment());
- SetScreenLocked(false);
- EXPECT_EQ(SHELF_ALIGNMENT_LEFT, shelf->GetAlignment());
-}
-
-// Makes sure shelf alignment is correct for login and add user screens.
-TEST_F(ShelfLockingManagerTest, AlignmentLockedWhileSessionLocked) {
- WmShelf* shelf = GetPrimaryShelf();
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->GetAlignment());
-
- shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
- EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->GetAlignment());
-
- SetSessionState(session_manager::SessionState::LOGIN_PRIMARY);
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment());
- SetSessionState(session_manager::SessionState::ACTIVE);
- EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->GetAlignment());
-
- SetSessionState(session_manager::SessionState::LOGIN_SECONDARY);
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment());
- SetSessionState(session_manager::SessionState::ACTIVE);
- EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->GetAlignment());
-}
-
-// Makes sure shelf alignment changes are stored, not set, while locked.
-TEST_F(ShelfLockingManagerTest, AlignmentChangesDeferredWhileLocked) {
- WmShelf* shelf = GetPrimaryShelf();
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->GetAlignment());
-
- SetScreenLocked(true);
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment());
- shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
- EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment());
- SetScreenLocked(false);
- EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->GetAlignment());
-}
-
-} // namespace test
-} // namespace ash
« no previous file with comments | « ash/common/shelf/shelf_locking_manager.cc ('k') | ash/common/shelf/shelf_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698