#include "chrome/browser/notifications/notification_display_service_tester.h"
#include "base/functional/bind.h"
#include "base/memory/singleton.h"
#include "chrome/browser/notifications/notification_display_service.h"
#include "chrome/browser/notifications/notification_display_service_factory.h"
#include "chrome/browser/notifications/stub_notification_display_service.h"
#include "chrome/browser/notifications/system_notification_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
#include "components/keyed_service/core/keyed_service.h"
#include "ui/message_center/public/cpp/notification.h"
namespace {
NotificationDisplayServiceTester* g_tester = …;
class NotificationDisplayServiceShutdownNotifierFactory
: public BrowserContextKeyedServiceShutdownNotifierFactory { … };
}
NotificationDisplayServiceTester::NotificationDisplayServiceTester(
Profile* profile)
: … { … }
NotificationDisplayServiceTester::~NotificationDisplayServiceTester() { … }
NotificationDisplayServiceTester* NotificationDisplayServiceTester::Get() { … }
void NotificationDisplayServiceTester::SetNotificationAddedClosure(
base::RepeatingClosure closure) { … }
void NotificationDisplayServiceTester::SetNotificationClosedClosure(
base::RepeatingClosure closure) { … }
std::vector<message_center::Notification>
NotificationDisplayServiceTester::GetDisplayedNotificationsForType(
NotificationHandler::Type type) { … }
std::optional<message_center::Notification>
NotificationDisplayServiceTester::GetNotification(
const std::string& notification_id) const { … }
const NotificationCommon::Metadata*
NotificationDisplayServiceTester::GetMetadataForNotification(
const message_center::Notification& notification) { … }
void NotificationDisplayServiceTester::SimulateClick(
NotificationHandler::Type notification_type,
const std::string& notification_id,
std::optional<int> action_index,
std::optional<std::u16string> reply) { … }
void NotificationDisplayServiceTester::SimulateSettingsClick(
NotificationHandler::Type notification_type,
const std::string& notification_id) { … }
void NotificationDisplayServiceTester::RemoveNotification(
NotificationHandler::Type type,
const std::string& notification_id,
bool by_user,
bool silent) { … }
void NotificationDisplayServiceTester::RemoveAllNotifications(
NotificationHandler::Type type,
bool by_user) { … }
void NotificationDisplayServiceTester::SetProcessNotificationOperationDelegate(
const StubNotificationDisplayService::ProcessNotificationOperationCallback&
delegate) { … }
void NotificationDisplayServiceTester::OnProfileShutdown() { … }
void NotificationDisplayServiceTester::EnsureFactoryBuilt() { … }