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

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

Issue 2803593003: Delay deleting profile notification (Closed)
Patch Set: fix hats test 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
« no previous file with comments | « chrome/browser/notifications/message_center_notification_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fe5253b444b0c1047c636a171c0a34f1c384e3a9 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"
@@ -139,6 +140,11 @@ class MessageCenterNotificationsTest : public InProcessBrowserTest {
base::UTF8ToUTF16("chrome-test://testing/"),
GURL("chrome-test://testing/"), "REPLACE-ME", data, new_delegate);
}
+
+ void RunLoopUntilIdle() {
+ base::RunLoop loop;
+ loop.RunUntilIdle();
+ }
};
IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, RetrieveBaseParts) {
@@ -201,19 +207,23 @@ IN_PROC_BROWSER_TEST_F(MessageCenterNotificationsTest, VerifyKeepAlives) {
TestDelegate* delegate;
manager()->Add(CreateTestNotification("a", &delegate), profile());
+ RunLoopUntilIdle();
EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));
TestDelegate* delegate2;
manager()->Add(CreateRichTestNotification("b", &delegate2), profile());
+ RunLoopUntilIdle();
EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));
manager()->CancelById("a", NotificationUIManager::GetProfileID(profile()));
+ RunLoopUntilIdle();
EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));
manager()->CancelById("b", NotificationUIManager::GetProfileID(profile()));
+ RunLoopUntilIdle();
EXPECT_FALSE(KeepAliveRegistry::GetInstance()->IsOriginRegistered(
KeepAliveOrigin::NOTIFICATION));
« no previous file with comments | « chrome/browser/notifications/message_center_notification_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698