#include "content/test/mock_platform_notification_service.h"
#include <set>
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_event_dispatcher.h"
#include "content/public/browser/platform_notification_context.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/persistent_notification_status.h"
#include "third_party/blink/public/common/notifications/platform_notification_data.h"
namespace content {
MockPlatformNotificationService::MockPlatformNotificationService(
BrowserContext* context)
: … { … }
MockPlatformNotificationService::~MockPlatformNotificationService() = default;
void MockPlatformNotificationService::DisplayNotification(
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
const blink::PlatformNotificationData& notification_data,
const blink::NotificationResources& notification_resources) { … }
void MockPlatformNotificationService::DisplayPersistentNotification(
const std::string& notification_id,
const GURL& service_worker_scope,
const GURL& origin,
const blink::PlatformNotificationData& notification_data,
const blink::NotificationResources& notification_resources) { … }
void MockPlatformNotificationService::CloseNotification(
const std::string& notification_id) { … }
void MockPlatformNotificationService::ClosePersistentNotification(
const std::string& notification_id) { … }
void MockPlatformNotificationService::GetDisplayedNotifications(
DisplayedNotificationsCallback callback) { … }
void MockPlatformNotificationService::GetDisplayedNotificationsForOrigin(
const GURL& origin,
DisplayedNotificationsCallback callback) { … }
void MockPlatformNotificationService::ScheduleTrigger(base::Time timestamp) { … }
base::Time MockPlatformNotificationService::ReadNextTriggerTimestamp() { … }
int64_t MockPlatformNotificationService::ReadNextPersistentNotificationId() { … }
void MockPlatformNotificationService::RecordNotificationUkmEvent(
const NotificationDatabaseData& data) { … }
void MockPlatformNotificationService::SimulateClick(
const std::string& title,
const std::optional<int>& action_index,
const std::optional<std::u16string>& reply) { … }
void MockPlatformNotificationService::SimulateClose(const std::string& title,
bool by_user) { … }
void MockPlatformNotificationService::ReplaceNotificationIfNeeded(
const std::string& notification_id) { … }
}