| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/common/system/update/tray_update.h" | |
| 6 | |
| 7 #include "ash/common/system/tray/system_tray.h" | |
| 8 #include "ash/common/system/tray/system_tray_controller.h" | |
| 9 #include "ash/common/test/ash_test.h" | |
| 10 #include "ash/common/wm_shell.h" | |
| 11 #include "ash/public/interfaces/update.mojom.h" | |
| 12 | |
| 13 namespace ash { | |
| 14 | |
| 15 using TrayUpdateTest = AshTest; | |
| 16 | |
| 17 // Tests that the update icon becomes visible when an update becomes | |
| 18 // available. | |
| 19 TEST_F(TrayUpdateTest, VisibilityAfterUpdate) { | |
| 20 TrayUpdate* tray_update = GetPrimarySystemTray()->tray_update(); | |
| 21 | |
| 22 // The system starts with no update pending, so the icon isn't visible. | |
| 23 EXPECT_FALSE(tray_update->tray_view()->visible()); | |
| 24 | |
| 25 // Simulate an update. | |
| 26 WmShell::Get()->system_tray_controller()->ShowUpdateIcon( | |
| 27 mojom::UpdateSeverity::LOW, false); | |
| 28 | |
| 29 // Tray item is now visible. | |
| 30 EXPECT_TRUE(tray_update->tray_view()->visible()); | |
| 31 } | |
| 32 | |
| 33 } // namespace ash | |
| OLD | NEW |