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

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

Issue 804793004: Unflake PlatformNotificationServiceTest.NotificationPermissionLastUsage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/platform_notification_service_unittest.cc
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc
index 322c55e2083d9008a2d279e0ac4180262b203bfd..32f2546677dc9713b8199b9ad929493173d8ba48 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "chrome/browser/notifications/notification_test_util.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
@@ -202,6 +203,9 @@ TEST_F(PlatformNotificationServiceTest, NotificationPermissionLastUsage) {
origin, origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
EXPECT_GT(after_page_notification, begin_time);
+ // Ensure that there is at least some time between the two calls.
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1));
+
service()->DisplayPersistentNotification(profile(),
42 /* sw_registration_id */,
origin,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698