Chromium Code Reviews| Index: chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc |
| diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc |
| index b061e67fa5f22e9da1576509914f31c3fd98d10b..1e2cd820c180e4e821b0b9a0f3e8935eb6535b18 100644 |
| --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc |
| +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos_browsertest_chromeos.cc |
| @@ -13,6 +13,8 @@ |
| #include "ash/common/system/date/tray_date.h" |
| #include "ash/common/system/date/tray_system_info.h" |
| #include "ash/common/system/tray/system_tray.h" |
| +#include "ash/common/system/update/tray_update.h" |
| +#include "ash/common/wm_shell.h" |
| #include "ash/shell.h" |
| #include "base/macros.h" |
| #include "chrome/browser/chromeos/login/login_manager_test.h" |
| @@ -129,4 +131,29 @@ IN_PROC_BROWSER_TEST_F(SystemTrayDelegateChromeOSTest, |
| EXPECT_EQ(base::k24HourClock, GetHourType()); |
| } |
| +// Test that a flash update causes the update UI to show in the system menu. |
| +IN_PROC_BROWSER_TEST_F(SystemTrayDelegateChromeOSTest, |
| + TestFlashUpdateTrayIcon) { |
| + ash::TrayUpdate* tray_update = ash::Shell::GetInstance() |
| + ->GetPrimarySystemTray() |
| + ->GetTrayUpdateForTesting(); |
| + |
| + ash::UpdateInfo initial_info; |
| + ash::WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo( |
| + &initial_info); |
| + EXPECT_FALSE(initial_info.update_required); |
| + |
| + // When no update is pending, the item isn't visible. |
| + EXPECT_FALSE(tray_update->tray_view()->visible()); |
| + |
| + chromeos::SystemTrayDelegateChromeOS::Get()->SetFlashUpdateAvailable(); |
| + |
| + ash::UpdateInfo post_info; |
| + ash::WmShell::Get()->system_tray_delegate()->GetSystemUpdateInfo(&post_info); |
| + EXPECT_TRUE(post_info.update_required); |
| + |
| + // Tray item is now visible. |
| + EXPECT_TRUE(tray_update->tray_view()->visible()); |
| +} |
|
James Cook
2016/12/01 20:41:13
Nice test. Simple and well documented.
Greg K
2016/12/02 01:07:32
Acknowledged.
|
| + |
| } // namespace chromeos |