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

Unified Diff: ash/common/system/tiles/tray_tiles_unittest.cc

Issue 2732813002: chromeos: Move files in //ash/common to //ash, part 1 (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
« no previous file with comments | « ash/common/system/tiles/tray_tiles.cc ('k') | ash/common/system/toast/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tiles/tray_tiles_unittest.cc
diff --git a/ash/common/system/tiles/tray_tiles_unittest.cc b/ash/common/system/tiles/tray_tiles_unittest.cc
deleted file mode 100644
index 39308bd0d69e41200ea7ccacea75260dc7b24d32..0000000000000000000000000000000000000000
--- a/ash/common/system/tiles/tray_tiles_unittest.cc
+++ /dev/null
@@ -1,92 +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/system/tiles/tray_tiles.h"
-
-#include "ash/common/session/session_state_delegate.h"
-#include "ash/common/system/tiles/tiles_default_view.h"
-#include "ash/common/wm_shell.h"
-#include "ash/test/ash_test_base.h"
-#include "ui/views/controls/button/custom_button.h"
-#include "ui/views/view.h"
-
-namespace ash {
-
-class TrayTilesTest : public test::AshTestBase {
- public:
- TrayTilesTest() {}
- ~TrayTilesTest() override {}
-
- void SetUp() override {
- test::AshTestBase::SetUp();
- tray_tiles_.reset(new TrayTiles(GetPrimarySystemTray()));
- }
-
- void TearDown() override {
- tray_tiles_.reset();
- test::AshTestBase::TearDown();
- }
-
- views::CustomButton* GetSettingsButton() {
- return tray_tiles()->default_view_->settings_button_;
- }
-
- views::CustomButton* GetHelpButton() {
- return tray_tiles()->default_view_->help_button_;
- }
-
- views::CustomButton* GetLockButton() {
- return tray_tiles()->default_view_->lock_button_;
- }
-
- views::CustomButton* GetPowerButton() {
- return tray_tiles()->default_view_->power_button_;
- }
-
- TrayTiles* tray_tiles() { return tray_tiles_.get(); }
-
- private:
- std::unique_ptr<TrayTiles> tray_tiles_;
-
- DISALLOW_COPY_AND_ASSIGN(TrayTilesTest);
-};
-
-TEST_F(TrayTilesTest, ButtonStatesWithAddingUser) {
- SetUserAddingScreenRunning(true);
- std::unique_ptr<views::View> default_view(
- tray_tiles()->CreateDefaultViewForTesting(LoginStatus::USER));
- EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
-}
-
-TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusNotLoggedIn) {
- std::unique_ptr<views::View> default_view(
- tray_tiles()->CreateDefaultViewForTesting(LoginStatus::NOT_LOGGED_IN));
- EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
-}
-
-TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusLocked) {
- std::unique_ptr<views::View> default_view(
- tray_tiles()->CreateDefaultViewForTesting(LoginStatus::LOCKED));
- EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_DISABLED);
- EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
-}
-
-TEST_F(TrayTilesTest, ButtonStatesWithLoginStatusUser) {
- std::unique_ptr<views::View> default_view(
- tray_tiles()->CreateDefaultViewForTesting(LoginStatus::USER));
- EXPECT_EQ(GetSettingsButton()->state(), views::Button::STATE_NORMAL);
- EXPECT_EQ(GetHelpButton()->state(), views::Button::STATE_NORMAL);
- EXPECT_EQ(GetLockButton()->state(), views::Button::STATE_NORMAL);
- EXPECT_EQ(GetPowerButton()->state(), views::Button::STATE_NORMAL);
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/system/tiles/tray_tiles.cc ('k') | ash/common/system/toast/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698