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

Unified Diff: ash/system/night_light/tray_night_light_unittest.cc

Issue 2857103007: [Night Light] CL2: Ash and system tray work (Closed)
Patch Set: Update comment Created 3 years, 7 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/system/night_light/tray_night_light.cc ('k') | ash/system/tiles/tiles_default_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/night_light/tray_night_light_unittest.cc
diff --git a/ash/system/night_light/tray_night_light_unittest.cc b/ash/system/night_light/tray_night_light_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a99b68bc35c8d0e50b188ca76819b98bc7139abe
--- /dev/null
+++ b/ash/system/night_light/tray_night_light_unittest.cc
@@ -0,0 +1,33 @@
+// Copyright 2017 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/system/night_light/tray_night_light.h"
+
+#include "ash/shell.h"
+#include "ash/system/night_light/night_light_controller.h"
+#include "ash/system/tray/system_tray.h"
+#include "ash/test/ash_test_base.h"
+
+namespace ash {
+
+namespace {
+
+using TrayNightLightTest = test::AshTestBase;
+
+// Tests that when NightLight is active, its tray icon in the System Tray is
+// visible.
+TEST_F(TrayNightLightTest, TestNightLightTrayVisibility) {
+ SystemTray* tray = GetPrimarySystemTray();
+ TrayNightLight* tray_night_light = tray->tray_night_light();
+ NightLightController* controller = Shell::Get()->night_light_controller();
+ controller->SetEnabled(false);
+ ASSERT_FALSE(controller->enabled());
+ EXPECT_FALSE(tray_night_light->tray_view()->visible());
+ controller->SetEnabled(true);
+ EXPECT_TRUE(tray_night_light->tray_view()->visible());
+}
+
+} // namespace
+
+} // namespace ash
« no previous file with comments | « ash/system/night_light/tray_night_light.cc ('k') | ash/system/tiles/tiles_default_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698