Commit 889aab0c authored by Dominique Fauteux-Chapleau's avatar Dominique Fauteux-Chapleau Committed by Commit Bot

Reuse download DeepScanning browser tests for Enterprise Connectors

Bug: 1076083
Change-Id: Ia53108bb26aab9232c93e19514e0c63ddb1518d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216291Reviewed-by: default avatarDaniel Rubery <drubery@chromium.org>
Commit-Queue: Dominique Fauteux-Chapleau <domfc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772715}
parent 217938e0
...@@ -92,9 +92,13 @@ class FakeBinaryFCMService : public BinaryFCMService { ...@@ -92,9 +92,13 @@ class FakeBinaryFCMService : public BinaryFCMService {
class DownloadDeepScanningBrowserTest class DownloadDeepScanningBrowserTest
: public DeepScanningBrowserTestBase, : public DeepScanningBrowserTestBase,
public content::DownloadManager::Observer, public content::DownloadManager::Observer,
public download::DownloadItem::Observer { public download::DownloadItem::Observer,
public testing::WithParamInterface<bool> {
public: public:
DownloadDeepScanningBrowserTest() {} DownloadDeepScanningBrowserTest()
: DeepScanningBrowserTestBase(use_legacy_policies()) {}
bool use_legacy_policies() const { return GetParam(); }
void OnDownloadCreated(content::DownloadManager* manager, void OnDownloadCreated(content::DownloadManager* manager,
download::DownloadItem* item) override { download::DownloadItem* item) override {
...@@ -284,7 +288,9 @@ class DownloadDeepScanningBrowserTest ...@@ -284,7 +288,9 @@ class DownloadDeepScanningBrowserTest
base::flat_set<download::DownloadItem*> download_items_; base::flat_set<download::DownloadItem*> download_items_;
}; };
IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, INSTANTIATE_TEST_SUITE_P(, DownloadDeepScanningBrowserTest, testing::Bool());
IN_PROC_BROWSER_TEST_P(DownloadDeepScanningBrowserTest,
SafeDownloadHasCorrectDangerType) { SafeDownloadHasCorrectDangerType) {
// The file is SAFE according to the metadata check // The file is SAFE according to the metadata check
ClientDownloadResponse metadata_response; ClientDownloadResponse metadata_response;
...@@ -324,7 +330,7 @@ IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, ...@@ -324,7 +330,7 @@ IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest,
EXPECT_EQ(item->GetState(), download::DownloadItem::COMPLETE); EXPECT_EQ(item->GetState(), download::DownloadItem::COMPLETE);
} }
IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, FailedScanFailsOpen) { IN_PROC_BROWSER_TEST_P(DownloadDeepScanningBrowserTest, FailedScanFailsOpen) {
// The file is SAFE according to the metadata check // The file is SAFE according to the metadata check
ClientDownloadResponse metadata_response; ClientDownloadResponse metadata_response;
metadata_response.set_verdict(ClientDownloadResponse::SAFE); metadata_response.set_verdict(ClientDownloadResponse::SAFE);
...@@ -362,7 +368,7 @@ IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, FailedScanFailsOpen) { ...@@ -362,7 +368,7 @@ IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, FailedScanFailsOpen) {
EXPECT_EQ(item->GetState(), download::DownloadItem::COMPLETE); EXPECT_EQ(item->GetState(), download::DownloadItem::COMPLETE);
} }
IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, IN_PROC_BROWSER_TEST_P(DownloadDeepScanningBrowserTest,
PartialFailureShowsMalwareWarning) { PartialFailureShowsMalwareWarning) {
// The file is SAFE according to the metadata check // The file is SAFE according to the metadata check
ClientDownloadResponse metadata_response; ClientDownloadResponse metadata_response;
...@@ -402,7 +408,7 @@ IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, ...@@ -402,7 +408,7 @@ IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest,
EXPECT_EQ(item->GetState(), download::DownloadItem::IN_PROGRESS); EXPECT_EQ(item->GetState(), download::DownloadItem::IN_PROGRESS);
} }
IN_PROC_BROWSER_TEST_F(DownloadDeepScanningBrowserTest, IN_PROC_BROWSER_TEST_P(DownloadDeepScanningBrowserTest,
PartialFailureShowsDlpWarning) { PartialFailureShowsDlpWarning) {
// The file is SAFE according to the metadata check // The file is SAFE according to the metadata check
ClientDownloadResponse metadata_response; ClientDownloadResponse metadata_response;
...@@ -460,7 +466,11 @@ class WhitelistedUrlDeepScanningBrowserTest ...@@ -460,7 +466,11 @@ class WhitelistedUrlDeepScanningBrowserTest
} }
}; };
IN_PROC_BROWSER_TEST_F(WhitelistedUrlDeepScanningBrowserTest, INSTANTIATE_TEST_SUITE_P(,
WhitelistedUrlDeepScanningBrowserTest,
testing::Bool());
IN_PROC_BROWSER_TEST_P(WhitelistedUrlDeepScanningBrowserTest,
WhitelistedUrlStillDoesDlp) { WhitelistedUrlStillDoesDlp) {
// The file is SAFE according to the metadata check // The file is SAFE according to the metadata check
ClientDownloadResponse metadata_response; ClientDownloadResponse metadata_response;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment