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

Unified Diff: chrome/browser/notifications/message_center_notifications_browsertest.cc

Issue 2803593003: Delay deleting profile notification (Closed)
Patch Set: updated comment Created 3 years, 8 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: chrome/browser/notifications/message_center_notifications_browsertest.cc
diff --git a/chrome/browser/notifications/message_center_notifications_browsertest.cc b/chrome/browser/notifications/message_center_notifications_browsertest.cc
index 49de13b4ec9c89d7908e3243dbb2085ce7ec0135..d357c1007d3b2157c6582616164a2e383f7fab82 100644
--- a/chrome/browser/notifications/message_center_notifications_browsertest.cc
+++ b/chrome/browser/notifications/message_center_notifications_browsertest.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -201,19 +202,35 @@ IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, VerifyKeepAlives) {
TestDelegate* delegate;
manager()->Add(CreateTestNotification("a", &delegate), profile());
+ {
+ base::RunLoop loop;
+ loop.RunUntilIdle();
+ }
stevenjb 2017/04/07 20:16:23 nit: These could but put in a helper method, e.g.
oshima 2017/04/07 20:23:01 Done.
EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));
TestDelegate* delegate2;
manager()->Add(CreateRichTestNotification("b", &delegate2), profile());
+ {
+ base::RunLoop loop;
+ loop.RunUntilIdle();
+ }
EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));
manager()->CancelById("a", NotificationUIManager::GetProfileID(profile()));
+ {
+ base::RunLoop loop;
+ loop.RunUntilIdle();
+ }
EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));
manager()->CancelById("b", NotificationUIManager::GetProfileID(profile()));
+ {
+ base::RunLoop loop;
+ loop.RunUntilIdle();
+ }
EXPECT_FALSE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));

Powered by Google App Engine
This is Rietveld 408576698