summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@chromium.org>2014-12-15 11:58:29 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-15 19:58:46 +0000
commit94fa21a960e55bf0f7e72c92e5cfc40f51a327c8 (patch)
tree509589246f9676216aed3c92286ada5602814697
parentc4983d0d04b0b3349756cc0bad45dd13324cf82b (diff)
downloadchromium_src-94fa21a960e55bf0f7e72c92e5cfc40f51a327c8.zip
chromium_src-94fa21a960e55bf0f7e72c92e5cfc40f51a327c8.tar.gz
chromium_src-94fa21a960e55bf0f7e72c92e5cfc40f51a327c8.tar.bz2
Unflake PlatformNotificationServiceTest.NotificationPermissionLastUsage
Add a minor pause between displaying a non-persistent and a persistent notification to ensure that the two permission usage timestamps are different. BUG=442407 Review URL: https://codereview.chromium.org/804793004 Cr-Commit-Position: refs/heads/master@{#308400}
-rw-r--r--chrome/browser/notifications/platform_notification_service_unittest.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc
index 322c55e..32f2546 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,