#include <memory>
#include "base/containers/circular_deque.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/apps/app_service/app_launch_params.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/apps/app_service/browser_app_launcher.h"
#include "chrome/browser/apps/platform_apps/app_browsertest_util.h"
#include "chrome/browser/extensions/api/notifications/extension_notification_display_helper.h"
#include "chrome/browser/extensions/api/notifications/extension_notification_display_helper_factory.h"
#include "chrome/browser/extensions/api/notifications/extension_notification_handler.h"
#include "chrome/browser/extensions/api/notifications/notifications_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/notifications/notification_display_service_tester.h"
#include "chrome/browser/notifications/notification_handler.h"
#include "chrome/browser/notifications/notifier_state_tracker.h"
#include "chrome/browser/notifications/notifier_state_tracker_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
#include "content/public/test/browser_test.h"
#include "extensions/browser/api/test/test_api.h"
#include "extensions/browser/api_test_utils.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/app_window/native_app_window.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_host_test_helper.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/features/feature.h"
#include "extensions/common/mojom/view_type.mojom.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "ui/message_center/public/cpp/notification.h"
#include "ui/message_center/public/cpp/notifier_id.h"
#if BUILDFLAG(IS_MAC)
#include "base/mac/mac_util.h"
#endif
ContextType;
AppWindow;
AppWindowRegistry;
Extension;
ExtensionNotificationDisplayHelper;
ExtensionNotificationDisplayHelperFactory;
ResultCatcher;
utils;
namespace {
enum class WindowState { … };
class NotificationsApiTest : public extensions::ExtensionApiTest { … };
class NotificationsApiTestWithBackgroundType
: public NotificationsApiTest,
public testing::WithParamInterface<ContextType> { … };
}
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
IN_PROC_BROWSER_TEST_P(NotificationsApiTestWithBackgroundType, TestBasicUsage) { … }
#if BUILDFLAG(IS_LINUX) && defined(THREAD_SANITIZER)
#define MAYBE_TestEvents …
#else
#define MAYBE_TestEvents …
#endif
IN_PROC_BROWSER_TEST_P(NotificationsApiTestWithBackgroundType,
MAYBE_TestEvents) { … }
IN_PROC_BROWSER_TEST_P(NotificationsApiTestWithBackgroundType, TestCSP) { … }
#if !BUILDFLAG(IS_MAC)
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestByUser) { … }
#endif
IN_PROC_BROWSER_TEST_P(NotificationsApiTestWithBackgroundType,
TestPartialUpdate) { … }
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestGetPermissionLevel) { … }
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestOnPermissionLevelChanged) { … }
#if !BUILDFLAG(IS_MAC)
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestUserGesture) { … }
#endif
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestRequireInteraction) { … }
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestShouldDisplayNormal) { … }
#if !BUILDFLAG(IS_MAC)
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestShouldDisplayFullscreen) { … }
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestShouldDisplayMultiFullscreen) { … }
IN_PROC_BROWSER_TEST_F(NotificationsApiTest,
TestShouldDisplayPopupNotification) { … }
#endif
IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestSmallImage) { … }