Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2017)

Unified Diff: chrome/browser/plugins/flash_download_interception_unittest.cc

Issue 2378573005: [HBD] Blanket BLOCK on all non-HTTP(s) and non-FILE URLs for Flash. (Closed)
Patch Set: fix dat merge Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/plugins/flash_download_interception_unittest.cc
diff --git a/chrome/browser/plugins/flash_download_interception_unittest.cc b/chrome/browser/plugins/flash_download_interception_unittest.cc
index b86b25fc4ad12d641f852a34ea079548dde627e2..74a4c976aea37cf8c5b24620465538951c811bc6 100644
--- a/chrome/browser/plugins/flash_download_interception_unittest.cc
+++ b/chrome/browser/plugins/flash_download_interception_unittest.cc
@@ -29,7 +29,7 @@ TEST_F(FlashDownloadInterceptionTest, PreferHtmlOverPluginsOff) {
feature_list.InitAndDisableFeature(features::kPreferHtmlOverPlugins);
EXPECT_FALSE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(),
+ host_content_settings_map(), GURL("http://source-page.com"),
GURL("https://get.adobe.com/flashplayer/"), true));
}
@@ -38,20 +38,20 @@ TEST_F(FlashDownloadInterceptionTest, DownloadUrlVariations) {
feature_list.InitAndEnableFeature(features::kPreferHtmlOverPlugins);
EXPECT_TRUE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(),
+ host_content_settings_map(), GURL("http://source-page.com"),
GURL("https://get.adobe.com/flashplayer/"), true));
// HTTP and path variant.
EXPECT_TRUE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(), GURL("http://get.adobe.com/flash"),
- true));
+ host_content_settings_map(), GURL("http://source-page.com"),
+ GURL("http://get.adobe.com/flash"), true));
EXPECT_FALSE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(), GURL("https://www.example.com"),
- true));
+ host_content_settings_map(), GURL("http://source-page.com"),
+ GURL("https://www.example.com"), true));
EXPECT_FALSE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(),
+ host_content_settings_map(), GURL("http://source-page.com"),
GURL("http://example.com/get.adobe.com/flashplayer"), true));
}
@@ -59,6 +59,9 @@ TEST_F(FlashDownloadInterceptionTest, NavigationThrottleCancelsNavigation) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(features::kPreferHtmlOverPlugins);
+ // Set the source URL to an HTTP source.
+ NavigateAndCommit(GURL("http://example.com"));
+
std::unique_ptr<NavigationHandle> handle =
NavigationHandle::CreateNavigationHandleForTesting(
GURL("https://get.adobe.com/flashplayer"), main_rfh());
@@ -78,7 +81,7 @@ TEST_F(FlashDownloadInterceptionTest, OnlyInterceptOnDetectContentSetting) {
// Default Setting (which is DETECT)
EXPECT_TRUE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(),
+ host_content_settings_map(), GURL("http://source-page.com"),
GURL("https://get.adobe.com/flashplayer/"), true));
// No intercept on ALLOW.
@@ -87,18 +90,18 @@ TEST_F(FlashDownloadInterceptionTest, OnlyInterceptOnDetectContentSetting) {
map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTING_ALLOW);
EXPECT_FALSE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(),
+ host_content_settings_map(), GURL("http://source-page.com"),
GURL("https://get.adobe.com/flashplayer/"), true));
// Intercept on both explicit DETECT and BLOCK.
map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTING_BLOCK);
EXPECT_TRUE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(),
+ host_content_settings_map(), GURL("http://source-page.com"),
GURL("https://get.adobe.com/flashplayer/"), true));
map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTING_DETECT_IMPORTANT_CONTENT);
EXPECT_TRUE(FlashDownloadInterception::ShouldStopFlashDownloadAction(
- host_content_settings_map(), GURL(),
+ host_content_settings_map(), GURL("http://source-page.com"),
GURL("https://get.adobe.com/flashplayer/"), true));
}
« no previous file with comments | « chrome/browser/plugins/flash_download_interception.cc ('k') | chrome/browser/plugins/flash_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698