chromium/chrome/browser/notifications/scheduler/internal/scheduled_notification_manager_unittest.cc

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

#include "chrome/browser/notifications/scheduler/internal/scheduled_notification_manager.h"

#include <utility>
#include <vector>

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/task_environment.h"
#include "base/uuid.h"
#include "chrome/browser/notifications/scheduler/internal/collection_store.h"
#include "chrome/browser/notifications/scheduler/internal/icon_store.h"
#include "chrome/browser/notifications/scheduler/internal/notification_entry.h"
#include "chrome/browser/notifications/scheduler/internal/scheduler_config.h"
#include "chrome/browser/notifications/scheduler/public/notification_params.h"
#include "chrome/browser/notifications/scheduler/public/notification_scheduler_constant.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
Invoke;
Entries;

namespace notifications {
namespace {

const char kGuid[] =;
const char kNonExistentGuid[] =;
const char16_t kTitle[] =;
const char kSmallIconUuid[] =;
const char kLargeIconUuid[] =;

NotificationEntry CreateNotificationEntry(SchedulerClientType type) {}

// Verifies notification entry is same as expected.
void VerifyNotificationEntry(const NotificationEntry* entry,
                             const NotificationEntry* expected) {}

IconStore::IconTypeBundleMap CreateIcons() {}

class MockNotificationStore : public CollectionStore<NotificationEntry> {};

class MockIconStore : public IconStore {};

class ScheduledNotificationManagerTest : public testing::Test {};

// Verify that error is received when notification database failed to
// initialize.
TEST_F(ScheduledNotificationManagerTest, NotificationDbInitFailed) {}

// Verify that error is received when icon database failed to initialize.
TEST_F(ScheduledNotificationManagerTest, IconDbInitFailed) {}

// Verify that residual expired icons are deleted when icon database is
// initialized.
TEST_F(ScheduledNotificationManagerTest, IconDbInitAndLoadKeys) {}

// Test to schedule a notification.
TEST_F(ScheduledNotificationManagerTest, ScheduleNotification) {}

// Verifies that schedules a notification with unregistered client will fail.
TEST_F(ScheduledNotificationManagerTest, ScheduleInvalidNotification) {}

// Verifies that schedules a notification with duplicate guid will fail.
TEST_F(ScheduledNotificationManagerTest, ScheduleNotificationDuplicateGuid) {}

// Test to schedule a notification without guid, we will auto generated one.
TEST_F(ScheduledNotificationManagerTest, ScheduleNotificationEmptyGuid) {}

// Test to display a notification.
TEST_F(ScheduledNotificationManagerTest, DisplayNotification) {}

// Test to display non-existing notification.
TEST_F(ScheduledNotificationManagerTest, DisplayNotificationWithoutEntry) {}

// Verify GetAllNotifications API, the notification should be sorted based on
// creation timestamp.
TEST_F(ScheduledNotificationManagerTest, GetAllNotifications) {}

// Verifies GetNotifications() can return the correct values.
TEST_F(ScheduledNotificationManagerTest, GetNotifications) {}

// Verify DeleteNotifications API, all notifications with given
// SchedulerClientType should be deleted.
TEST_F(ScheduledNotificationManagerTest, DeleteNotifications) {}

// Verifies that unused notifications will be deleted during initialization.
TEST_F(ScheduledNotificationManagerTest, PruneNotifications) {}

// Test to schedule a notification with two icons in notification data.
TEST_F(ScheduledNotificationManagerTest, ScheduleNotificationWithIcons) {}

// Test to schedule a notification failed on saving icons.
TEST_F(ScheduledNotificationManagerTest, ScheduleNotificationWithIconsFailed) {}

// Verifies the case that failed to add to the notification store.
TEST_F(ScheduledNotificationManagerTest, ScheduleAddNotificationFailed) {}

// Test to display a notification with icons.
TEST_F(ScheduledNotificationManagerTest, DisplayNotificationWithIcons) {}

// Test to display a notification with icons loaded failed.
TEST_F(ScheduledNotificationManagerTest, DisplayNotificationWithIconsFailed) {}

}  // namespace
}  // namespace notifications