#include "components/reporting/client/report_queue_impl.h"
#include <cstddef>
#include <memory>
#include <optional>
#include <utility>
#include "base/containers/queue.h"
#include "base/json/json_reader.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/gtest_util.h"
#include "base/test/task_environment.h"
#include "base/types/expected.h"
#include "base/values.h"
#include "components/reporting/client/mock_report_queue.h"
#include "components/reporting/client/report_queue_configuration.h"
#include "components/reporting/proto/synced/record_constants.pb.h"
#include "components/reporting/proto/test.pb.h"
#include "components/reporting/storage/storage_module_interface.h"
#include "components/reporting/storage/test_storage_module.h"
#include "components/reporting/util/rate_limiter_interface.h"
#include "components/reporting/util/status.h"
#include "components/reporting/util/status_macros.h"
#include "components/reporting/util/statusor.h"
#include "components/reporting/util/test_support_callbacks.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
AllOf;
EndsWith;
Eq;
Invoke;
MockFunction;
NiceMock;
Not;
NotNull;
Property;
Return;
StrEq;
WithArg;
TestStorageModule;
namespace reporting {
namespace {
constexpr char kTestMessage[] = …;
class MockRateLimiter : public RateLimiterInterface { … };
class ReportQueueImplTest : public testing::Test { … };
TEST_F(ReportQueueImplTest, SuccessfulStringRecord) { … }
TEST_F(ReportQueueImplTest, SuccessfulBaseValueRecord) { … }
TEST_F(ReportQueueImplTest, SuccessfulProtoRecord) { … }
TEST_F(ReportQueueImplTest,
NonMetricDataFailsToEnqueueToEventMetricDestination) { … }
TEST_F(ReportQueueImplTest,
NonMetricDataFailsToEnqueueToTelemetryMetricDestination) { … }
TEST_F(ReportQueueImplTest,
NonMetricDataFailsToEnqueueToInfoMetricDestination) { … }
TEST_F(ReportQueueImplTest, SuccessfulProtoRecordWithRateLimiter) { … }
TEST_F(ReportQueueImplTest, SuccessfulProtoRecordWithReservedSpace) { … }
TEST_F(ReportQueueImplTest, SuccessfulProtoRecordWithSource) { … }
TEST_F(ReportQueueImplTest, SuccessfulProtoRecordWithSourceVersion) { … }
TEST_F(ReportQueueImplTest, CallSuccessCallbackFailure) { … }
TEST_F(ReportQueueImplTest, EnqueueStringFailsOnPolicy) { … }
TEST_F(ReportQueueImplTest, EnqueueProtoFailsOnPolicy) { … }
TEST_F(ReportQueueImplTest, EnqueueValueFailsOnPolicy) { … }
TEST_F(ReportQueueImplTest, EnqueueAndFlushSuccess) { … }
TEST_F(ReportQueueImplTest, EnqueueSuccessFlushFailure) { … }
TEST_F(ReportQueueImplTest, SuccessfulSpeculativeStringRecord) { … }
TEST_F(ReportQueueImplTest, SuccessfulSpeculativeStringRecordWithRateLimiter) { … }
TEST_F(ReportQueueImplTest,
SuccessfulSpeculativeStringRecordWithReservedSpace) { … }
TEST_F(ReportQueueImplTest, SuccessfulSpeculativeStringRecordWithSource) { … }
TEST_F(ReportQueueImplTest,
SuccessfulSpeculativeStringRecordWithSourceVersion) { … }
TEST_F(ReportQueueImplTest, SpeculativeQueueMultipleRecordsAfterCreation) { … }
TEST_F(ReportQueueImplTest, SpeculativeQueueCreationFailedToCreate) { … }
TEST_F(ReportQueueImplTest, SpeculativeQueueEnqueueAndCreationFailed) { … }
TEST_F(ReportQueueImplTest, EnqueueRecordWithInvalidPriority) { … }
TEST_F(ReportQueueImplTest, FlushSpeculativeReportQueue) { … }
TEST_F(ReportQueueImplTest, FlushUninitializedSpeculativeReportQueue) { … }
TEST_F(ReportQueueImplTest, FlushFailedSpeculativeReportQueue) { … }
TEST_F(ReportQueueImplTest, AsyncProcessingReportQueue) { … }
TEST_F(ReportQueueImplTest, AsyncProcessingSpeculativeReportQueue) { … }
TEST_F(ReportQueueImplTest, GetDestinationForReportQueue) { … }
TEST_F(ReportQueueImplTest, GetDestinationForSpeculativeReportQueueBeforeInit) { … }
TEST_F(ReportQueueImplTest, GetDestinationForSpeculativeReportQueueAfterInit) { … }
}
}