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

Unified Diff: ash/system/tray/system_tray_unittest.cc

Issue 2008993004: Add a test of updating cached height for popup notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: ash/system/tray/system_tray_unittest.cc
diff --git a/ash/system/tray/system_tray_unittest.cc b/ash/system/tray/system_tray_unittest.cc
index f77b4e2c2faa25716bbffaf3d0eb1cb78de3e5bb..2e4ee5bed7d9a6878e6ff0d1b0f03906c58a6a10 100644
--- a/ash/system/tray/system_tray_unittest.cc
+++ b/ash/system/tray/system_tray_unittest.cc
@@ -16,6 +16,7 @@
#include "ash/system/tray/system_tray_item.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_popup_item_container.h"
+#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/test/ash_test_base.h"
#include "ash/wm/window_util.h"
#include "base/run_loop.h"
@@ -547,6 +548,28 @@ TEST_F(SystemTrayTest, TrayPopupItemContainerTouchFeedbackCancellation) {
generator.ReleaseTouch();
EXPECT_FALSE(view->active());
}
+
+TEST_F(SystemTrayTest, SystemTrayHeightWithBubble) {
+ StatusAreaWidget* widget =
+ Shell::GetPrimaryRootWindowController()->shelf()->status_area_widget();
+ SystemTray* tray = widget->system_tray();
+ WebNotificationTray* notification_tray =
+ tray->status_area_widget()->web_notification_tray();
+
+ // Ensure the initial system tray height is zero.
+ EXPECT_EQ(0, notification_tray->system_tray_height());
+
+ // Show the default view, ensure the system tray height is changed.
+ tray->ShowDefaultView(BUBBLE_CREATE_NEW);
+ RunAllPendingInMessageLoop();
+ EXPECT_LT(0, notification_tray->system_tray_height());
+
+ // Hide the default view, ensure the system tray height is back to zero.
+ ASSERT_TRUE(tray->CloseSystemBubble());
+ RunAllPendingInMessageLoop();
+
+ EXPECT_EQ(0, notification_tray->system_tray_height());
+}
#endif // OS_CHROMEOS
} // namespace test

Powered by Google App Engine
This is Rietveld 408576698