Index: ash/common/system/tray/system_tray_unittest.cc |
diff --git a/ash/common/system/tray/system_tray_unittest.cc b/ash/common/system/tray/system_tray_unittest.cc |
index 6a9c270fc2058a587173a9288d6ebcbb172f8e0a..abdd347651cce32ff0aead7bcda7f804493bf01c 100644 |
--- a/ash/common/system/tray/system_tray_unittest.cc |
+++ b/ash/common/system/tray/system_tray_unittest.cc |
@@ -60,7 +60,18 @@ class ModalWidgetDelegate : public views::WidgetDelegateView { |
} // namespace |
-typedef AshTestBase SystemTrayTest; |
+class SystemTrayTest : public AshTestBase { |
+ public: |
+ SystemTrayTest() {} |
+ ~SystemTrayTest() override {} |
+ |
+ void ShutDownLogoutButtonTray(StatusAreaWidget* widget) { |
+ widget->logout_button_tray_ = nullptr; |
+ } |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(SystemTrayTest); |
+}; |
// Verifies only the visible default views are recorded in the |
// "Ash.SystemMenu.DefaultView.VisibleItems" histogram. |
@@ -664,6 +675,15 @@ TEST_F(SystemTrayTest, SystemTrayHeightWithBubble) { |
EXPECT_EQ(0, notification_tray->tray_bubble_height_for_test()); |
} |
+ |
+// Calling OnVisibilityChange on StatusAreaWidget that has been Shutdown, see |
+// crbug.com/671293. Test if crash is mitigated. |
+TEST_F(SystemTrayTest, SystemTrayInitialization) { |
+ StatusAreaWidget* widget = StatusAreaWidgetTestHelper::GetStatusAreaWidget(); |
+ ShutDownLogoutButtonTray(widget); |
+ WebNotificationTray* notification_tray = widget->web_notification_tray(); |
+ widget->OnTrayVisibilityChanged(notification_tray); |
+} |
#endif // OS_CHROMEOS |
} // namespace test |