#include "components/domain_reliability/test_util.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "components/domain_reliability/scheduler.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace domain_reliability {
namespace {
class MockTimer : public MockableTime::Timer { … };
}
TestCallback::TestCallback()
: … { … }
TestCallback::~TestCallback() = default;
void TestCallback::OnCalled() { … }
MockUploader::MockUploader(UploadRequestCallback callback)
: … { … }
MockUploader::~MockUploader() = default;
bool MockUploader::discard_uploads() const { … }
void MockUploader::UploadReport(
const std::string& report_json,
int max_upload_depth,
const GURL& upload_url,
const net::NetworkAnonymizationKey& network_anonymization_key,
UploadCallback callback) { … }
void MockUploader::Shutdown() { … }
void MockUploader::SetDiscardUploads(bool discard_uploads) { … }
int MockUploader::GetDiscardedUploadCount() const { … }
base::TimeTicks MockTickClock::NowTicks() const { … }
MockTime::MockTime()
: … { … }
MockTime::~MockTime() { … }
base::Time MockTime::Now() const { … }
base::TimeTicks MockTime::NowTicks() const { … }
std::unique_ptr<MockableTime::Timer> MockTime::CreateTimer() { … }
const base::TickClock* MockTime::AsTickClock() const { … }
void MockTime::Advance(base::TimeDelta delta) { … }
void MockTime::AddTask(base::TimeDelta delay, base::OnceClosure task) { … }
void MockTime::AdvanceToInternal(base::TimeTicks target_ticks) { … }
DomainReliabilityScheduler::Params MakeTestSchedulerParams() { … }
std::unique_ptr<DomainReliabilityConfig> MakeTestConfig() { … }
std::unique_ptr<DomainReliabilityConfig> MakeTestConfigWithOrigin(
const url::Origin& origin) { … }
}