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

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: Rebased 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
« no previous file with comments | « no previous file | ash/system/web_notification/ash_popup_alignment_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27694a3dac90070857a3be8d15bff5a9474554ea..f1590259e38a62d9b02bd29c9afe3d877404a84b 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"
@@ -552,6 +553,29 @@ TEST_F(SystemTrayTest, TrayPopupItemContainerTouchFeedbackCancellation) {
generator.ReleaseTouch();
EXPECT_FALSE(view->active());
}
+
+TEST_F(SystemTrayTest, SystemTrayHeightWithBubble) {
+ StatusAreaWidget* widget = Shell::GetPrimaryRootWindowController()
+ ->shelf_widget()
+ ->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_for_test());
+
+ // 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_for_test());
+
+ // 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_for_test());
+}
#endif // OS_CHROMEOS
} // namespace test
« no previous file with comments | « no previous file | ash/system/web_notification/ash_popup_alignment_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698