Add a delay to showing notifications
Adding a 6 second delay to showing any non system component
notifications after login. This is to reduce clutter of
notifications when a user logs in.
Bug: 1189228
Change-Id: I6e91a8313a4851c5a8ee76851c54e54f24ee5e4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2771898
Commit-Queue: Ahmed Mehfooz <[email protected]>
Reviewed-by: James Cook <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Reviewed-by: Yaron Friedman <[email protected]>
Reviewed-by: Toni Baržić <[email protected]>
Cr-Commit-Position: refs/heads/master@{#867311}
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index e22344e..6164c70 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -23,6 +23,7 @@
#include "ash/session/test_session_controller_client.h"
#include "ash/shell.h"
#include "ash/shell_init_params.h"
+#include "ash/system/message_center/session_state_notification_blocker.h"
#include "ash/system/model/system_tray_model.h"
#include "ash/system/screen_layout_observer.h"
#include "ash/test/ash_test_views_delegate.h"
@@ -249,6 +250,12 @@
Shell::CreateInstance(std::move(shell_init_params));
Shell* shell = Shell::Get();
+ // Disable the notification delay timer used to prevent non system
+ // notifications from showing up right after login. This needs to be done
+ // before any user sessions are added since the delay timer starts right
+ // after that.
+ SessionStateNotificationBlocker::SetUseLoginNotificationDelayForTest(false);
+
// Cursor is visible by default in tests.
shell->cursor_manager()->ShowCursor();