| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/tiles/tray_tiles.h" | 5 #include "ash/system/tiles/tray_tiles.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" |
| 8 #include "ash/system/night_light/night_light_controller.h" |
| 7 #include "ash/system/night_light/night_light_toggle_button.h" | 9 #include "ash/system/night_light/night_light_toggle_button.h" |
| 8 #include "ash/system/tiles/tiles_default_view.h" | 10 #include "ash/system/tiles/tiles_default_view.h" |
| 9 #include "ash/system/tray/system_menu_button.h" | 11 #include "ash/system/tray/system_menu_button.h" |
| 10 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
| 11 #include "ash/test/test_session_controller_client.h" | 13 #include "ash/test/test_session_controller_client.h" |
| 14 #include "base/command_line.h" |
| 12 #include "components/user_manager/user_type.h" | 15 #include "components/user_manager/user_type.h" |
| 13 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
| 14 | 17 |
| 15 using views::Button; | 18 using views::Button; |
| 16 | 19 |
| 17 namespace ash { | 20 namespace ash { |
| 18 | 21 |
| 19 // Tests manually control their session state. | 22 // Tests manually control their session state. |
| 20 class TrayTilesTest : public test::NoSessionAshTestBase { | 23 class TrayTilesTest : public test::NoSessionAshTestBase { |
| 21 public: | 24 public: |
| 22 TrayTilesTest() {} | 25 TrayTilesTest() {} |
| 23 ~TrayTilesTest() override {} | 26 ~TrayTilesTest() override {} |
| 24 | 27 |
| 25 void SetUp() override { | 28 void SetUp() override { |
| 29 // Explicitly enable the NightLight feature for the tests. |
| 30 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 31 ash::switches::kAshEnableNightLight); |
| 32 |
| 26 test::NoSessionAshTestBase::SetUp(); | 33 test::NoSessionAshTestBase::SetUp(); |
| 27 tray_tiles_.reset(new TrayTiles(GetPrimarySystemTray())); | 34 tray_tiles_.reset(new TrayTiles(GetPrimarySystemTray())); |
| 28 } | 35 } |
| 29 | 36 |
| 30 void TearDown() override { | 37 void TearDown() override { |
| 31 tray_tiles_.reset(); | 38 tray_tiles_.reset(); |
| 32 test::NoSessionAshTestBase::TearDown(); | 39 test::NoSessionAshTestBase::TearDown(); |
| 33 } | 40 } |
| 34 | 41 |
| 35 views::CustomButton* GetSettingsButton() { | 42 views::CustomButton* GetSettingsButton() { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 std::unique_ptr<views::View> default_view( | 124 std::unique_ptr<views::View> default_view( |
| 118 tray_tiles()->CreateDefaultViewForTesting()); | 125 tray_tiles()->CreateDefaultViewForTesting()); |
| 119 EXPECT_EQ(Button::STATE_DISABLED, GetSettingsButton()->state()); | 126 EXPECT_EQ(Button::STATE_DISABLED, GetSettingsButton()->state()); |
| 120 EXPECT_EQ(Button::STATE_DISABLED, GetHelpButton()->state()); | 127 EXPECT_EQ(Button::STATE_DISABLED, GetHelpButton()->state()); |
| 121 EXPECT_EQ(Button::STATE_DISABLED, GetNightLightButton()->state()); | 128 EXPECT_EQ(Button::STATE_DISABLED, GetNightLightButton()->state()); |
| 122 EXPECT_EQ(Button::STATE_DISABLED, GetLockButton()->state()); | 129 EXPECT_EQ(Button::STATE_DISABLED, GetLockButton()->state()); |
| 123 EXPECT_EQ(Button::STATE_NORMAL, GetPowerButton()->state()); | 130 EXPECT_EQ(Button::STATE_NORMAL, GetPowerButton()->state()); |
| 124 } | 131 } |
| 125 | 132 |
| 126 } // namespace ash | 133 } // namespace ash |
| OLD | NEW |