chromium/content/browser/notifications/blink_notification_service_impl_unittest.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/browser/notifications/blink_notification_service_impl.h"

#include <stdint.h>

#include <memory>
#include <optional>
#include <set>
#include <utility>
#include <vector>

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
#include "content/browser/notifications/platform_notification_context_impl.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/public/browser/browser_context.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/mock_permission_manager.h"
#include "content/public/test/mock_render_process_host.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "content/test/mock_platform_notification_service.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/functions.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/notifications/notification_constants.h"
#include "third_party/blink/public/common/notifications/notification_resources.h"
#include "third_party/blink/public/common/permissions/permission_utils.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/notifications/notification_service.mojom.h"
#include "third_party/blink/public/mojom/permissions/permission_status.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration_options.mojom.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image_unittest_util.h"

_;
Return;

namespace content {

namespace {

const char kTestOrigin[] =;
const char kTestServiceWorkerUrl[] =;
const char kBadMessageImproperNotificationImage[] =;
const char kBadMessageInvalidNotificationTriggerTimestamp[] =;

class MockNonPersistentNotificationListener
    : public blink::mojom::NonPersistentNotificationListener {};

}  // anonymous namespace

class BlinkNotificationServiceImplTest : public ::testing::Test {};

TEST_F(BlinkNotificationServiceImplTest, GetPermissionStatus) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayNonPersistentNotificationWithPermission) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayNonPersistentNotificationWithoutPermission) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayNonPersistentNotificationWithContentImageSwitchOn) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayNonPersistentNotificationWithContentImageSwitchOff) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayPersistentNotificationWithContentImageSwitchOn) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayPersistentNotificationWithContentImageSwitchOff) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayPersistentNotificationWithPermission) {}

TEST_F(BlinkNotificationServiceImplTest, CloseDisplayedPersistentNotification) {}

TEST_F(BlinkNotificationServiceImplTest,
       ClosePersistentNotificationDeletesFromDatabase) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayPersistentNotificationWithoutPermission) {}

TEST_F(BlinkNotificationServiceImplTest,
       DisplayMultiplePersistentNotifications) {}

TEST_F(BlinkNotificationServiceImplTest, GetNotifications) {}

TEST_F(BlinkNotificationServiceImplTest, GetNotificationsWithoutPermission) {}

TEST_F(BlinkNotificationServiceImplTest, GetNotificationsWithFilter) {}

TEST_F(BlinkNotificationServiceImplTest, GetTriggeredNotificationsWithFilter) {}

TEST_F(BlinkNotificationServiceImplTest, ResourcesStoredForTriggered) {}

TEST_F(BlinkNotificationServiceImplTest, NotCallingDisplayForTriggered) {}

TEST_F(BlinkNotificationServiceImplTest, RejectsTriggerTimestampOverAYear) {}

}  // namespace content