Commit 94fa21a9 authored by peter's avatar peter Committed by Commit bot

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}
parent c4983d0d
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/notifications/notification_test_util.h" #include "chrome/browser/notifications/notification_test_util.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h" #include "chrome/browser/notifications/platform_notification_service_impl.h"
...@@ -202,6 +203,9 @@ TEST_F(PlatformNotificationServiceTest, NotificationPermissionLastUsage) { ...@@ -202,6 +203,9 @@ TEST_F(PlatformNotificationServiceTest, NotificationPermissionLastUsage) {
origin, origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); origin, origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
EXPECT_GT(after_page_notification, begin_time); 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(), service()->DisplayPersistentNotification(profile(),
42 /* sw_registration_id */, 42 /* sw_registration_id */,
origin, origin,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment