chromium/chrome/browser/notifications/scheduler/internal/background_task_coordinator_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/background_task_coordinator.h"

#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/test/task_environment.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_background_task_scheduler.h"
#include "chrome/browser/notifications/scheduler/test/fake_clock.h"
#include "chrome/browser/notifications/scheduler/test/mock_notification_background_task_scheduler.h"
#include "chrome/browser/notifications/scheduler/test/test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"

_;

namespace notifications {
namespace {

Notifications;
ClientStates;

const char kNow[] =;
const char kDeliverTimeWindowStart[] =;
const char kDeliverTimeWindowEnd[] =;
const char kTommorow[] =;

const char kGuid[] =;
const std::vector<test::ImpressionTestData> kSingleClientImpressionTestData =;

const std::vector<test::ImpressionTestData> kClientsImpressionTestData =;

struct TestData {};

class BackgroundTaskCoordinatorTest : public testing::Test {};

// No notification persisted, then no background task needs to be scheduled.
// And current task should be canceled.
TEST_F(BackgroundTaskCoordinatorTest, NoNotification) {}

// Test to schedule one notification.
TEST_F(BackgroundTaskCoordinatorTest, OneNotification) {}

// Verifies that the daily throttle for a particular notification type will
// block notification to show.
TEST_F(BackgroundTaskCoordinatorTest, ThrottlePerType) {}

// Verifies that the daily throttle for all notification types will
// block notification to show.
TEST_F(BackgroundTaskCoordinatorTest, ThrottleAllType) {}

// Verifies that a notification scheduled to show after today will still trigger
// a background task even if it is throttled today.
TEST_F(BackgroundTaskCoordinatorTest, ThrottlePerTypeNextDay) {}

// Verfies that notification with their deliver window expired will not trigger
// a background task.
TEST_F(BackgroundTaskCoordinatorTest, DeliverWindowPassed) {}

// Verfies that notification suppression will block the notification to be
// shown.
TEST_F(BackgroundTaskCoordinatorTest, Suppression) {}

// Verfies that notification will trigger background task if its deliver time
// window is after the suppression expiration time.
TEST_F(BackgroundTaskCoordinatorTest, DeliverTimeAfterSuppressionExpired) {}

// Test to schedule multiple notifications from multiple clients.
TEST_F(BackgroundTaskCoordinatorTest, MutipleNotifications) {}

// Verifies that the notification with NoThrottle priority will always trigger
// background task.
TEST_F(BackgroundTaskCoordinatorTest, NoThrottleNotifications) {}

}  // namespace
}  // namespace notifications