| 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..7da4c45336a5caf706a2814e4f1153f3d533a3de 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 {}
|
| +
|
| + bool IsWidgetInitialized(StatusAreaWidget* widget) {
|
| + return widget->is_initialized_;
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(SystemTrayTest);
|
| +};
|
|
|
| // Verifies only the visible default views are recorded in the
|
| // "Ash.SystemMenu.DefaultView.VisibleItems" histogram.
|
| @@ -664,6 +675,25 @@ 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();
|
| + EXPECT_TRUE(IsWidgetInitialized(widget));
|
| + widget->Shutdown();
|
| + EXPECT_FALSE(IsWidgetInitialized(widget));
|
| + WebNotificationTray* notification_tray =
|
| + StatusAreaWidgetTestHelper::GetStatusAreaWidget()
|
| + ->web_notification_tray();
|
| + widget->OnTrayVisibilityChanged(notification_tray);
|
| +
|
| + widget->CreateTrayViews();
|
| + EXPECT_TRUE(IsWidgetInitialized(widget));
|
| + notification_tray = StatusAreaWidgetTestHelper::GetStatusAreaWidget()
|
| + ->web_notification_tray();
|
| + widget->OnTrayVisibilityChanged(notification_tray);
|
| +}
|
| #endif // OS_CHROMEOS
|
|
|
| } // namespace test
|
|
|