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

Unified Diff: chrome/browser/download/download_target_determiner_unittest.cc

Issue 1862513003: Remove NPAPI from browser and utility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/download/download_target_determiner_unittest.cc
diff --git a/chrome/browser/download/download_target_determiner_unittest.cc b/chrome/browser/download/download_target_determiner_unittest.cc
index 26f67397b9caae1b78a73cdac0d0f77522bb45f7..295929d00ee1c9fb4286df8be224e34eed9a794e 100644
--- a/chrome/browser/download/download_target_determiner_unittest.cc
+++ b/chrome/browser/download/download_target_determiner_unittest.cc
@@ -1861,7 +1861,6 @@ class DownloadTargetDeterminerTestWithPlugin
content::PluginService* plugin_service =
content::PluginService::GetInstance();
plugin_service->Init();
- plugin_service->DisablePluginsDiscoveryForTesting();
old_plugin_service_filter_ = plugin_service->GetFilter();
plugin_service->SetFilter(&mock_plugin_filter_);
}
@@ -2019,72 +2018,6 @@ TEST_F(DownloadTargetDeterminerTestWithPlugin,
EXPECT_FALSE(target_info->is_filetype_handled_safely);
}
-// Check if secure handling of filetypes is determined correctly for NPAPI
-// plugins.
-TEST_F(DownloadTargetDeterminerTestWithPlugin,
- TargetDeterminer_CheckForSecureHandling_NPAPI) {
- // All test cases run with GetPathInDownloadDir(kInitialPath) as the inital
- // path.
- const base::FilePath::CharType kInitialPath[] =
- FILE_PATH_LITERAL("some_path/bar.txt");
- const char kTestMIMEType[] = "application/x-example-should-not-exist";
-
- DownloadTestCase kSecureHandlingTestCase = {
- AUTOMATIC,
- content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
- download_util::NOT_DANGEROUS,
- "http://example.com/foo.fakeext",
- "",
- FILE_PATH_LITERAL(""),
-
- FILE_PATH_LITERAL("foo.fakeext"),
- DownloadItem::TARGET_DISPOSITION_OVERWRITE,
-
- EXPECT_CRDOWNLOAD};
-
- content::PluginService* plugin_service =
- content::PluginService::GetInstance();
-
- // Can't run this test if NPAPI isn't supported.
- if (!plugin_service->NPAPIPluginsSupported())
- return;
-
- // Verify our test assumptions.
- {
- ForceRefreshOfPlugins();
- std::vector<content::WebPluginInfo> info;
- ASSERT_FALSE(plugin_service->GetPluginInfoArray(
- GURL(), kTestMIMEType, false, &info, NULL));
- ASSERT_EQ(0u, info.size())
- << "Name: " << info[0].name << ", Path: " << info[0].path.value();
- }
-
- ON_CALL(*delegate(), GetFileMimeType(
- GetPathInDownloadDir(FILE_PATH_LITERAL("foo.fakeext")), _))
- .WillByDefault(WithArg<1>(
- ScheduleCallback(kTestMIMEType)));
- scoped_ptr<content::MockDownloadItem> item(
- CreateActiveDownloadItem(1, kSecureHandlingTestCase));
- scoped_ptr<DownloadTargetInfo> target_info =
- RunDownloadTargetDeterminer(GetPathInDownloadDir(kInitialPath),
- item.get());
- EXPECT_FALSE(target_info->is_filetype_handled_safely);
-
- // Register a NPAPI plugin. This should not count as handling the filetype
- // securely.
- ScopedRegisterInternalPlugin npapi_plugin(
- plugin_service,
- content::WebPluginInfo::PLUGIN_TYPE_NPAPI,
- test_download_dir().AppendASCII("npapi"),
- kTestMIMEType,
- "fakeext");
- EXPECT_CALL(mock_plugin_filter_, MockPluginAvailable(npapi_plugin.path()))
- .WillRepeatedly(Return(true));
-
- target_info = RunDownloadTargetDeterminer(
- GetPathInDownloadDir(kInitialPath), item.get());
- EXPECT_FALSE(target_info->is_filetype_handled_safely);
-}
#endif // defined(ENABLE_PLUGINS)
} // namespace

Powered by Google App Engine
This is Rietveld 408576698