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/system/night_light/night_light_controller.h" |
7 #include "ash/system/night_light/night_light_toggle_button.h" | 8 #include "ash/system/night_light/night_light_toggle_button.h" |
8 #include "ash/system/tiles/tiles_default_view.h" | 9 #include "ash/system/tiles/tiles_default_view.h" |
9 #include "ash/system/tray/system_menu_button.h" | 10 #include "ash/system/tray/system_menu_button.h" |
10 #include "ash/test/ash_test_base.h" | 11 #include "ash/test/ash_test_base.h" |
11 #include "ash/test/test_session_controller_client.h" | 12 #include "ash/test/test_session_controller_client.h" |
12 #include "components/user_manager/user_type.h" | 13 #include "components/user_manager/user_type.h" |
13 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
14 | 15 |
15 using views::Button; | 16 using views::Button; |
16 | 17 |
17 namespace ash { | 18 namespace ash { |
18 | 19 |
19 // Tests manually control their session state. | 20 // Tests manually control their session state. |
20 class TrayTilesTest : public test::NoSessionAshTestBase { | 21 class TrayTilesTest : public test::NoSessionAshTestBase { |
21 public: | 22 public: |
22 TrayTilesTest() {} | 23 TrayTilesTest() {} |
23 ~TrayTilesTest() override {} | 24 ~TrayTilesTest() override {} |
24 | 25 |
25 void SetUp() override { | 26 void SetUp() override { |
| 27 NightLightController::EnableFeatureForTesting(); |
26 test::NoSessionAshTestBase::SetUp(); | 28 test::NoSessionAshTestBase::SetUp(); |
27 tray_tiles_.reset(new TrayTiles(GetPrimarySystemTray())); | 29 tray_tiles_.reset(new TrayTiles(GetPrimarySystemTray())); |
28 } | 30 } |
29 | 31 |
30 void TearDown() override { | 32 void TearDown() override { |
31 tray_tiles_.reset(); | 33 tray_tiles_.reset(); |
32 test::NoSessionAshTestBase::TearDown(); | 34 test::NoSessionAshTestBase::TearDown(); |
33 } | 35 } |
34 | 36 |
35 views::CustomButton* GetSettingsButton() { | 37 views::CustomButton* GetSettingsButton() { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 std::unique_ptr<views::View> default_view( | 119 std::unique_ptr<views::View> default_view( |
118 tray_tiles()->CreateDefaultViewForTesting()); | 120 tray_tiles()->CreateDefaultViewForTesting()); |
119 EXPECT_EQ(Button::STATE_DISABLED, GetSettingsButton()->state()); | 121 EXPECT_EQ(Button::STATE_DISABLED, GetSettingsButton()->state()); |
120 EXPECT_EQ(Button::STATE_DISABLED, GetHelpButton()->state()); | 122 EXPECT_EQ(Button::STATE_DISABLED, GetHelpButton()->state()); |
121 EXPECT_EQ(Button::STATE_DISABLED, GetNightLightButton()->state()); | 123 EXPECT_EQ(Button::STATE_DISABLED, GetNightLightButton()->state()); |
122 EXPECT_EQ(Button::STATE_DISABLED, GetLockButton()->state()); | 124 EXPECT_EQ(Button::STATE_DISABLED, GetLockButton()->state()); |
123 EXPECT_EQ(Button::STATE_NORMAL, GetPowerButton()->state()); | 125 EXPECT_EQ(Button::STATE_NORMAL, GetPowerButton()->state()); |
124 } | 126 } |
125 | 127 |
126 } // namespace ash | 128 } // namespace ash |
OLD | NEW |