#include "chrome/browser/enterprise/data_protection/paste_allowed_request.h"
#include "base/test/bind.h"
#include "base/test/test_future.h"
#include "chrome/browser/enterprise/connectors/analysis/content_analysis_delegate_base.h"
#include "chrome/browser/enterprise/connectors/test/deep_scanning_test_utils.h"
#include "chrome/browser/enterprise/data_protection/data_protection_clipboard_utils.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "components/enterprise/data_controls/core/browser/features.h"
#include "components/enterprise/data_controls/core/browser/test_utils.h"
#include "content/public/browser/clipboard_types.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/navigation_simulator.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/clipboard/clipboard_monitor.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/clipboard/test/test_clipboard.h"
namespace enterprise_data_protection {
namespace {
enterprise_connectors::ContentAnalysisDelegate* test_delegate_ = …;
constexpr char kScanId[] = …;
enterprise_connectors::ContentAnalysisResponse::Result CreateResult(
enterprise_connectors::ContentAnalysisResponse::Result::TriggeredRule::
Action action) { … }
enterprise_connectors::ContentAnalysisResponse CreateResponse(
enterprise_connectors::ContentAnalysisResponse::Result::TriggeredRule::
Action action) { … }
class PasteTestContentAnalysisDelegate
: public enterprise_connectors::ContentAnalysisDelegate { … };
class PasteAllowedRequestTest : public testing::Test { … };
class PasteAllowedRequestScanningTest : public PasteAllowedRequestTest { … };
}
TEST_F(PasteAllowedRequestTest, AddCallbacksAndComplete) { … }
TEST_F(PasteAllowedRequestTest, IsObsolete) { … }
TEST_F(PasteAllowedRequestTest, SameDestinationSource) { … }
TEST_F(PasteAllowedRequestTest, SameDestinationSource_AfterReplacement) { … }
TEST_F(PasteAllowedRequestTest, DifferentDestinationSource) { … }
TEST_F(PasteAllowedRequestTest,
DifferentDestinationSource_AllowedWithCachedRequest) { … }
TEST_F(PasteAllowedRequestTest,
DifferentDestinationSource_BlockedWithCachedRequest) { … }
TEST_F(PasteAllowedRequestTest, UnknownSource) { … }
TEST_F(PasteAllowedRequestTest, EmptyData) { … }
TEST_F(PasteAllowedRequestTest, EmptyData_SameSourceReplaced) { … }
TEST_F(PasteAllowedRequestTest, EmptyData_DifferentSourceReplaced) { … }
TEST_F(PasteAllowedRequestTest, CleanupObsoleteScanRequests) { … }
TEST_F(PasteAllowedRequestScanningTest, SameDestinationSource) { … }
TEST_F(PasteAllowedRequestScanningTest, DifferentDestinationSource) { … }
}