OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/system/night_light/tray_night_light.h" |
| 6 |
| 7 #include "ash/shell.h" |
| 8 #include "ash/system/night_light/night_light_controller.h" |
| 9 #include "ash/system/tray/system_tray.h" |
| 10 #include "ash/test/ash_test_base.h" |
| 11 |
| 12 namespace ash { |
| 13 |
| 14 namespace { |
| 15 |
| 16 using TrayNightLightTest = test::AshTestBase; |
| 17 |
| 18 // Tests that when NightLight is active, its tray icon in the System Tray is |
| 19 // visible. |
| 20 TEST_F(TrayNightLightTest, TestNightLightTrayVisibility) { |
| 21 SystemTray* tray = GetPrimarySystemTray(); |
| 22 TrayNightLight* tray_night_light = tray->tray_night_light(); |
| 23 NightLightController* controller = Shell::Get()->night_light_controller(); |
| 24 controller->SetEnabled(false); |
| 25 ASSERT_FALSE(controller->enabled()); |
| 26 EXPECT_FALSE(tray_night_light->tray_view()->visible()); |
| 27 controller->SetEnabled(true); |
| 28 EXPECT_TRUE(tray_night_light->tray_view()->visible()); |
| 29 } |
| 30 |
| 31 } // namespace |
| 32 |
| 33 } // namespace ash |
OLD | NEW |