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

Unified Diff: ash/system/update/tray_update_unittest.cc

Issue 2816253002: Display "Restart to update Adobe Flash Player" for Flash updates. (Closed)
Patch Set: Fix nits from last review Created 3 years, 8 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/update/tray_update.cc ('k') | chrome/browser/ui/ash/system_tray_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/system/update/tray_update.cc ('k') | chrome/browser/ui/ash/system_tray_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698