Chromium Code Reviews| 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)); |