#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/enterprise/connectors/test/deep_scanning_browsertest_base.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h"
#include "chrome/browser/enterprise/connectors/analysis/files_request_handler.h"
#include "chrome/browser/enterprise/connectors/connectors_service.h"
#include "chrome/browser/enterprise/connectors/test/deep_scanning_test_utils.h"
#include "chrome/browser/enterprise/connectors/test/fake_content_analysis_delegate.h"
#include "chrome/browser/policy/dm_token_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/testing_browser_process.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
namespace enterprise_connectors::test {
namespace {
constexpr char kDmToken[] = …;
constexpr base::TimeDelta kMinimumPendingDelay = …;
constexpr base::TimeDelta kSuccessTimeout = …;
constexpr base::TimeDelta kShowDialogDelay = …;
class UnresponsiveFilesRequestHandler : public FilesRequestHandler { … };
class UnresponsiveContentAnalysisDelegate : public FakeContentAnalysisDelegate { … };
}
DeepScanningBrowserTestBase::DeepScanningBrowserTestBase() { … }
DeepScanningBrowserTestBase::~DeepScanningBrowserTestBase() = default;
void DeepScanningBrowserTestBase::TearDownOnMainThread() { … }
void DeepScanningBrowserTestBase::SetUpDelegate() { … }
void DeepScanningBrowserTestBase::SetUpUnresponsiveDelegate() { … }
void DeepScanningBrowserTestBase::SetQuitClosure(
base::RepeatingClosure quit_closure) { … }
void DeepScanningBrowserTestBase::CallQuitClosure() { … }
void DeepScanningBrowserTestBase::SetStatusCallbackResponse(
ContentAnalysisResponse response) { … }
ContentAnalysisResponse DeepScanningBrowserTestBase::StatusCallback(
const std::string& contents,
const base::FilePath& path) { … }
void DeepScanningBrowserTestBase::CreateFilesForTest(
const std::vector<std::string>& paths,
const std::vector<std::string>& contents,
ContentAnalysisDelegate::Data* data,
const std::string& parent) { … }
const std::vector<base::FilePath>&
DeepScanningBrowserTestBase::created_file_paths() const { … }
}