#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/policy/messaging_layer/public/report_client.h"
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include "base/base64.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/types/expected.h"
#include "base/values.h"
#include "chrome/browser/enterprise/browser_management/management_service_factory.h"
#include "chrome/browser/policy/messaging_layer/public/report_client_test_util.h"
#include "chrome/browser/policy/messaging_layer/upload/file_upload_job_test_util.h"
#include "chrome/browser/policy/messaging_layer/util/dm_token_retriever_provider.h"
#include "chrome/browser/policy/messaging_layer/util/reporting_server_connector.h"
#include "chrome/browser/policy/messaging_layer/util/reporting_server_connector_test_util.h"
#include "chrome/browser/policy/messaging_layer/util/test_request_payload.h"
#include "components/policy/core/common/management/scoped_management_service_override_for_testing.h"
#include "components/reporting/client/dm_token_retriever.h"
#include "components/reporting/client/mock_dm_token_retriever.h"
#include "components/reporting/client/report_queue_configuration.h"
#include "components/reporting/client/report_queue_provider.h"
#include "components/reporting/encryption/decryption.h"
#include "components/reporting/encryption/primitives.h"
#include "components/reporting/encryption/testing_primitives.h"
#include "components/reporting/proto/synced/record_constants.pb.h"
#include "components/reporting/util/encrypted_reporting_json_keys.h"
#include "components/reporting/util/status.h"
#include "components/reporting/util/statusor.h"
#include "components/reporting/util/test_support_callbacks.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
Eq;
Invoke;
Ne;
SizeIs;
StrEq;
StrictMock;
WithArgs;
namespace reporting {
namespace {
constexpr char kDMToken[] = …;
class ReportClientTest : public ::testing::TestWithParam<bool> { … };
TEST_P(ReportClientTest, CreatesReportQueueWithDMToken) { … }
TEST_P(ReportClientTest, CreatesReportQueueGivenEventType) { … }
TEST_P(ReportClientTest, CreateReportQueueWhenDMTokenRetrievalFailure) { … }
TEST_P(ReportClientTest, CreatesTwoDifferentReportQueues) { … }
#if !BUILDFLAG(IS_CHROMEOS)
TEST_P(ReportClientTest, EnqueueMessageAndUpload) { … }
TEST_P(ReportClientTest, SpeculativelyEnqueueMessageAndUpload) { … }
#endif
INSTANTIATE_TEST_SUITE_P(…);
}
}