OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/plugins/flash_download_interception.h" | 5 #include "chrome/browser/plugins/flash_download_interception.h" |
6 | 6 |
7 #include "base/test/scoped_feature_list.h" | 7 #include "base/test/scoped_feature_list.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
9 #include "chrome/common/chrome_features.h" | 9 #include "chrome/common/chrome_features.h" |
10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 10 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 EXPECT_FALSE( | 37 EXPECT_FALSE( |
38 ShouldStopFlashDownloadAction("https://get.adobe.com/flashplayer/")); | 38 ShouldStopFlashDownloadAction("https://get.adobe.com/flashplayer/")); |
39 } | 39 } |
40 | 40 |
41 TEST_F(FlashDownloadInterceptionTest, DownloadUrlVariations) { | 41 TEST_F(FlashDownloadInterceptionTest, DownloadUrlVariations) { |
42 base::test::ScopedFeatureList feature_list; | 42 base::test::ScopedFeatureList feature_list; |
43 feature_list.InitAndEnableFeature(features::kPreferHtmlOverPlugins); | 43 feature_list.InitAndEnableFeature(features::kPreferHtmlOverPlugins); |
44 | 44 |
45 const char* const flash_intercept_urls[] = { | 45 const char* const flash_intercept_urls[] = { |
46 "https://get.adobe.com/flashplayer/", | 46 "https://get.adobe.com/flashplayer/", |
| 47 "http://get2.adobe.com/flashplayer/", |
47 "http://get.adobe.com/flash", | 48 "http://get.adobe.com/flash", |
48 "http://get.adobe.com/fr/flashplayer/", | 49 "http://get.adobe.com/fr/flashplayer/", |
49 "http://get.adobe.com/flashplayer", | 50 "http://get.adobe.com/flashplayer", |
50 "http://macromedia.com/go/getflashplayer", | 51 "http://macromedia.com/go/getflashplayer", |
51 "http://adobe.com/go/getflashplayer", | 52 "http://adobe.com/go/getflashplayer", |
52 "http://adobe.com/go/CA-H-GET-FLASH", | 53 "http://adobe.com/go/CA-H-GET-FLASH", |
53 "http://adobe.com/go/DE_CH-H-M-A2", | 54 "http://adobe.com/go/DE_CH-H-M-A2", |
54 "http://adobe.com/go/gntray_dl_getflashplayer_jp", | 55 "http://adobe.com/go/gntray_dl_getflashplayer_jp", |
55 "http://www.adobe.com/shockwave/download/download.cgi?" | 56 "http://www.adobe.com/shockwave/download/download.cgi?" |
56 "P1_Prod_Version=ShockwaveFlash", | 57 "P1_Prod_Version=ShockwaveFlash", |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Intercept on both explicit DETECT and BLOCK. | 130 // Intercept on both explicit DETECT and BLOCK. |
130 map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, | 131 map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, |
131 CONTENT_SETTING_BLOCK); | 132 CONTENT_SETTING_BLOCK); |
132 EXPECT_TRUE( | 133 EXPECT_TRUE( |
133 ShouldStopFlashDownloadAction("https://get.adobe.com/flashplayer/")); | 134 ShouldStopFlashDownloadAction("https://get.adobe.com/flashplayer/")); |
134 map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, | 135 map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, |
135 CONTENT_SETTING_DETECT_IMPORTANT_CONTENT); | 136 CONTENT_SETTING_DETECT_IMPORTANT_CONTENT); |
136 EXPECT_TRUE( | 137 EXPECT_TRUE( |
137 ShouldStopFlashDownloadAction("https://get.adobe.com/flashplayer/")); | 138 ShouldStopFlashDownloadAction("https://get.adobe.com/flashplayer/")); |
138 } | 139 } |
OLD | NEW |