| Index: ash/system/update/tray_update_unittest.cc
|
| diff --git a/ash/system/update/tray_update_unittest.cc b/ash/system/update/tray_update_unittest.cc
|
| index aa38649c662fbcf636de3c2671cd56c4d6aeeb13..6f6b918964f0ea57210e1ab0e37a6b75e253e403 100644
|
| --- a/ash/system/update/tray_update_unittest.cc
|
| +++ b/ash/system/update/tray_update_unittest.cc
|
| @@ -9,6 +9,8 @@
|
| #include "ash/system/tray/system_tray.h"
|
| #include "ash/system/tray/system_tray_controller.h"
|
| #include "ash/test/ash_test.h"
|
| +#include "base/strings/utf_string_conversions.h"
|
| +#include "ui/events/event.h"
|
|
|
| namespace ash {
|
|
|
| @@ -17,17 +19,38 @@ using TrayUpdateTest = AshTest;
|
| // Tests that the update icon becomes visible when an update becomes
|
| // available.
|
| TEST_F(TrayUpdateTest, VisibilityAfterUpdate) {
|
| - TrayUpdate* tray_update = GetPrimarySystemTray()->tray_update();
|
| + SystemTray* tray = GetPrimarySystemTray();
|
| + TrayUpdate* tray_update = tray->tray_update();
|
|
|
| // The system starts with no update pending, so the icon isn't visible.
|
| EXPECT_FALSE(tray_update->tray_view()->visible());
|
|
|
| // Simulate an update.
|
| Shell::Get()->system_tray_controller()->ShowUpdateIcon(
|
| - mojom::UpdateSeverity::LOW, false);
|
| + mojom::UpdateSeverity::LOW, false, mojom::UpdateType::SYSTEM);
|
|
|
| // Tray item is now visible.
|
| EXPECT_TRUE(tray_update->tray_view()->visible());
|
| +
|
| + tray->ShowDefaultView(BUBBLE_CREATE_NEW);
|
| + base::string16 label = tray_update->GetLabelForTesting();
|
| + EXPECT_EQ("Restart to update", base::UTF16ToUTF8(label));
|
| +}
|
| +
|
| +TEST_F(TrayUpdateTest, VisibilityAfterFlashUpdate) {
|
| + SystemTray* tray = GetPrimarySystemTray();
|
| + TrayUpdate* tray_update = tray->tray_update();
|
| +
|
| + // Simulate an update.
|
| + Shell::Get()->system_tray_controller()->ShowUpdateIcon(
|
| + mojom::UpdateSeverity::LOW, false, mojom::UpdateType::FLASH);
|
| +
|
| + // Tray item is now visible.
|
| + EXPECT_TRUE(tray_update->tray_view()->visible());
|
| +
|
| + tray->ShowDefaultView(BUBBLE_CREATE_NEW);
|
| + base::string16 label = tray_update->GetLabelForTesting();
|
| + EXPECT_EQ("Restart to update Adobe Flash Player", base::UTF16ToUTF8(label));
|
| }
|
|
|
| } // namespace ash
|
|
|