#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/enterprise/connectors/analysis/local_binary_upload_service.h"
#include "base/barrier_closure.h"
#include "base/containers/span.h"
#include "base/functional/callback_helpers.h"
#include "base/task/sequenced_task_runner.h"
#include "build/build_config.h"
#include "chrome/browser/enterprise/connectors/test/fake_content_analysis_sdk_manager.h"
#include "chrome/test/base/testing_profile.h"
#include "components/device_signals/core/browser/mock_system_signals_service_host.h"
#include "components/enterprise/connectors/core/analysis_settings.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace enterprise_connectors {
BinaryUploadService;
_;
Invoke;
NiceMock;
NotNull;
Return;
SaveArg;
constexpr char kFakeUserActionId[] = …;
constexpr char kFakeUserActionId2[] = …;
class MockRequest : public BinaryUploadService::Request { … };
class FakeLocalBinaryUploadService : public LocalBinaryUploadService { … };
class LocalBinaryUploadServiceTest : public testing::Test { … };
TEST_F(LocalBinaryUploadServiceTest, ClientCreatedFromMaybeAcknowledge) { … }
TEST_F(LocalBinaryUploadServiceTest, ClientDestroyedWhenAckStatusIsAbnormal) { … }
TEST_F(LocalBinaryUploadServiceTest, UploadSucceeds) { … }
TEST_F(LocalBinaryUploadServiceTest, UploadFailsWhenClientUnableToSend) { … }
TEST_F(LocalBinaryUploadServiceTest,
VerifyRequestTokenParityWhenUploadSucceeds) { … }
TEST_F(LocalBinaryUploadServiceTest, VerifyTabTitleIsSet) { … }
TEST_F(LocalBinaryUploadServiceTest, SomeRequestsArePending) { … }
TEST_F(LocalBinaryUploadServiceTest, PendingRequestsGetProcessed) { … }
TEST_F(LocalBinaryUploadServiceTest, AgentErrorMakesRequestPending) { … }
TEST_F(LocalBinaryUploadServiceTest, AgentErrorMakesManyRequestsPending) { … }
TEST_F(LocalBinaryUploadServiceTest, TimeoutWhileActive) { … }
TEST_F(LocalBinaryUploadServiceTest, TimeoutWhilePending) { … }
TEST_F(LocalBinaryUploadServiceTest, OnConnectionRetryCompletesPending) { … }
TEST_F(LocalBinaryUploadServiceTest, OnConnectionRetryCompletesManyPending) { … }
TEST_F(LocalBinaryUploadServiceTest, FailureAfterTooManyRetries) { … }
TEST_F(LocalBinaryUploadServiceTest, CancelRequests) { … }
TEST_F(LocalBinaryUploadServiceTest, CancelRequests_MultipleUserActions) { … }
TEST_F(LocalBinaryUploadServiceTest,
ClientDestroyedWhenCancelStatusIsAbnormal) { … }
TEST_F(LocalBinaryUploadServiceTest, VerifyAgent) { … }
TEST_F(LocalBinaryUploadServiceTest, VerifyAgent_NotOSVerified) { … }
TEST_F(LocalBinaryUploadServiceTest, VerifyAgent_NoSubject) { … }
TEST_F(LocalBinaryUploadServiceTest, VerifyAgent_VerifyNotNeeded) { … }
TEST_F(LocalBinaryUploadServiceTest, VerifyAgent_MissingSystemSignalService) { … }
}