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..a7c131c2849897a347eb4d6394ebda45b9338366 100644 |
--- a/ash/system/update/tray_update_unittest.cc |
+++ b/ash/system/update/tray_update_unittest.cc |
@@ -9,6 +9,9 @@ |
#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" |
+#include "ui/views/controls/label.h" |
namespace ash { |
@@ -17,17 +20,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()->text(); |
+ 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()->text(); |
+ EXPECT_EQ("Restart to update Adobe Flash Player", base::UTF16ToUTF8(label)); |
} |
} // namespace ash |