chromium/chrome/browser/dips/persistent_repeating_timer_unittest.cc

// Copyright 2024 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/dips/persistent_repeating_timer.h"

#include <memory>

#include "base/functional/bind.h"
#include "base/location.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

PersistentRepeatingTimer;

// How long calls to SlowStorage::{Get,Set}LastFired() take.
constexpr base::TimeDelta kStorageDelay =;
// The delay between executions of the PersistentRepeatingTimer.
constexpr base::TimeDelta kTimerDelay =;

// Storage that takes `kStorageDelay` for reads/writes to happen.
class SlowStorage : public PersistentRepeatingTimer::Storage {};

}  // namespace

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

// Checks that the missing pref is treated like an old one.
TEST_F(PersistentRepeatingTimerTest, MissingPref) {}

// Checks that spurious calls to Start() have no effect.
TEST_F(PersistentRepeatingTimerTest, MultipleStarts) {}

TEST_F(PersistentRepeatingTimerTest, RecentPref) {}

TEST_F(PersistentRepeatingTimerTest, OldPref) {}