diff --git a/chromium_src/content/browser/renderer_host/render_process_host_impl.cc b/chromium_src/content/browser/renderer_host/render_process_host_impl.cc deleted file mode 100644 index ccc572863192..000000000000 --- a/chromium_src/content/browser/renderer_host/render_process_host_impl.cc +++ /dev/null @@ -1,10 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/content/browser/renderer_host/brave_plugin_registry_impl.h" -#include "content/browser/renderer_host/plugin_registry_impl.h" - -#define PluginRegistryImpl BravePluginRegistryImpl -#include "../../../../../content/browser/renderer_host/render_process_host_impl.cc" -#undef PluginRegistryImpl diff --git a/chromium_src/third_party/blink/renderer/modules/plugins/navigator_pluginstest.cc b/chromium_src/third_party/blink/renderer/modules/plugins/navigator_pluginstest.cc deleted file mode 100644 index d4c66083384d..000000000000 --- a/chromium_src/third_party/blink/renderer/modules/plugins/navigator_pluginstest.cc +++ /dev/null @@ -1,125 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "base/path_service.h" -#include "brave/browser/brave_content_browser_client.h" -#include "brave/common/brave_paths.h" -#include "chrome/browser/content_settings/host_content_settings_map_factory.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/common/chrome_content_client.h" -#include "chrome/test/base/in_process_browser_test.h" -#include "chrome/test/base/ui_test_utils.h" -#include "components/content_settings/core/browser/host_content_settings_map.h" -#include "components/content_settings/core/common/content_settings.h" -#include "components/content_settings/core/common/content_settings_types.h" -#include "content/public/test/browser_test_utils.h" - -const char kNavigatorPluginsTest[] = "/navigatorplugins.html"; -const char kNavigatorMimeTypesTest[] = "/navigatormimetypes.html"; -const char kNavigatorMimeTypesTestWithFlash[] = "/navigatormimetypeswithflash.html"; - -const char kFlashPluginExists[] = - "domAutomationController.send(Array.from(navigator.plugins).filter(" - " x => Array.from(x).some(" - " y => y.type === 'application/x-shockwave-flash')).length)"; - -class NavigatorPluginsTest : public InProcessBrowserTest { - public: - void SetUpOnMainThread() override { - InProcessBrowserTest::SetUpOnMainThread(); - - content_client_.reset(new ChromeContentClient); - content::SetContentClient(content_client_.get()); - browser_content_client_.reset(new BraveContentBrowserClient()); - content::SetBrowserClientForTesting(browser_content_client_.get()); - content::SetupCrossSiteRedirector(embedded_test_server()); - - brave::RegisterPathProvider(); - base::FilePath test_data_dir; - base::PathService::Get(brave::DIR_TEST_DATA, &test_data_dir); - embedded_test_server()->ServeFilesFromDirectory(test_data_dir); - - ASSERT_TRUE(embedded_test_server()->Start()); - } - - HostContentSettingsMap * content_settings() { - return HostContentSettingsMapFactory::GetForProfile(browser()->profile()); - } - - void AllowFlash(GURL url) { - content_settings()->SetContentSettingCustomScope( - ContentSettingsPattern::FromString(url.spec()), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), - CONTENT_SETTING_ALLOW); - } - - void TearDown() override { - browser_content_client_.reset(); - content_client_.reset(); - } - - private: - std::unique_ptr content_client_; - std::unique_ptr browser_content_client_; - base::ScopedTempDir temp_user_data_dir_; -}; - -IN_PROC_BROWSER_TEST_F(NavigatorPluginsTest, ConstPluginsWithoutFlash) { - GURL url = embedded_test_server()->GetURL(kNavigatorPluginsTest); - ui_test_utils::NavigateToURL(browser(), url); - content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - ASSERT_TRUE(content::WaitForLoadStop(contents)); - EXPECT_EQ(url, contents->GetURL()); - - bool constantPlugins; - ASSERT_TRUE(ExecuteScriptAndExtractBool( - contents, - "window.domAutomationController.send(constantPlugins())", - &constantPlugins)); - EXPECT_TRUE(constantPlugins); -} - -IN_PROC_BROWSER_TEST_F(NavigatorPluginsTest, ConstMimeTypesWithoutFlash) { - GURL url = embedded_test_server()->GetURL(kNavigatorMimeTypesTest); - ui_test_utils::NavigateToURL(browser(), url); - content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - ASSERT_TRUE(content::WaitForLoadStop(contents)); - EXPECT_EQ(url, contents->GetURL()); - - bool constantMimeTypes; - ASSERT_TRUE(ExecuteScriptAndExtractBool( - contents, - "window.domAutomationController.send(constantMimeTypes())", - &constantMimeTypes)); - EXPECT_TRUE(constantMimeTypes); -} - - -IN_PROC_BROWSER_TEST_F(NavigatorPluginsTest, ConstPluginsAndMimeTypesWithFlash) { - int len; - GURL url = embedded_test_server()->GetURL(kNavigatorMimeTypesTestWithFlash); - AllowFlash(url); - ui_test_utils::NavigateToURL(browser(), url); - content::WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); - ASSERT_TRUE(content::WaitForLoadStop(contents)); - EXPECT_EQ(url, contents->GetURL()); - - ASSERT_TRUE(ExecuteScriptAndExtractInt(contents, - kFlashPluginExists, &len)); - ASSERT_LE(len, 1); - - // If len == 0, flash is not installed. Skip this test - if (len == 0) { - return; - } - - bool constantMimeTypes; - ASSERT_TRUE(ExecuteScriptAndExtractBool( - contents, - "window.domAutomationController.send(constantMimeTypes())", - &constantMimeTypes)); - EXPECT_TRUE(constantMimeTypes); -} \ No newline at end of file diff --git a/content/browser/renderer_host/brave_plugin_registry_impl.cc b/content/browser/renderer_host/brave_plugin_registry_impl.cc deleted file mode 100644 index 5cb6e4724024..000000000000 --- a/content/browser/renderer_host/brave_plugin_registry_impl.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/content/browser/renderer_host/brave_plugin_registry_impl.h" - -#include "base/strings/utf_string_conversions.h" -#include "content/public/common/content_constants.h" - -namespace content { - -BravePluginRegistryImpl::BravePluginRegistryImpl(ResourceContext* resource_context) - : PluginRegistryImpl(resource_context) {} - -BravePluginRegistryImpl::~BravePluginRegistryImpl() {} - -void BravePluginRegistryImpl::GetPluginsComplete(GetPluginsCallback callback, - std::vector plugins) { - std::vector filtered_plugins; - - for(std::vector::iterator it = plugins.begin(); - it != plugins.end(); ++it) { - if ((*it) && (*it)->name == base::ASCIIToUTF16(kFlashPluginName)) { - filtered_plugins.push_back(std::move(*it)); - } - } - std::move(callback).Run(std::move(filtered_plugins)); -} - -void BravePluginRegistryImpl::GetPlugins(bool refresh, - const url::Origin& main_frame_origin, - GetPluginsCallback callback) { - PluginRegistryImpl::GetPlugins(refresh, main_frame_origin, - base::BindOnce( - &BravePluginRegistryImpl::GetPluginsComplete, base::Unretained(this), - std::move(callback))); -} - -} // namespace content \ No newline at end of file diff --git a/content/browser/renderer_host/brave_plugin_registry_impl.h b/content/browser/renderer_host/brave_plugin_registry_impl.h deleted file mode 100644 index 4010ba1659fc..000000000000 --- a/content/browser/renderer_host/brave_plugin_registry_impl.h +++ /dev/null @@ -1,29 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_ -#define BRAVE_CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_ - -#include "content/browser/renderer_host/plugin_registry_impl.h" - -namespace content { - -class ResourceContext; - -class BravePluginRegistryImpl : public PluginRegistryImpl { - public: - BravePluginRegistryImpl(ResourceContext* resource_context); - ~BravePluginRegistryImpl() override; - - void GetPlugins(bool refresh, - const url::Origin& main_frame_origin, - GetPluginsCallback callback) override; - private: - void GetPluginsComplete(GetPluginsCallback callback, - std::vector plugins); -}; - -} // namespace content - -#endif // BRAVE_CONTENT_BROWSER_RENDERER_HOST_PLUGIN_REGISTRY_IMPL_H_ \ No newline at end of file diff --git a/patches/content-browser-BUILD.gn.patch b/patches/content-browser-BUILD.gn.patch deleted file mode 100644 index 72ec31ef471e..000000000000 --- a/patches/content-browser-BUILD.gn.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index a17fee9e275e817f97e943a48e36fa9e67340c9d..7de443b32075e0c98a2f081d2b5de12492a689c5 100644 ---- a/content/browser/BUILD.gn -+++ b/content/browser/BUILD.gn -@@ -2192,6 +2192,12 @@ jumbo_source_set("browser") { - "//ppapi/proxy:ipc", - "//ppapi/shared_impl", - ] -+ if (brave_chromium_build) { -+ sources += [ -+ "//brave/content/browser/renderer_host/brave_plugin_registry_impl.cc", -+ "//brave/content/browser/renderer_host/brave_plugin_registry_impl.h", -+ ] -+ } - if (use_ozone) { - sources += [ "renderer_host/pepper/pepper_truetype_font_list_ozone.cc" ] - } diff --git a/test/BUILD.gn b/test/BUILD.gn index 3a24c6b645c5..4cd135586a60 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -298,7 +298,6 @@ test("brave_browser_tests") { "//brave/chromium_src/components/content_settings/core/browser/brave_content_settings_registry_browsertest.cc", "//brave/chromium_src/third_party/blink/renderer/modules/battery/navigator_batterytest.cc", "//brave/chromium_src/third_party/blink/renderer/modules/bluetooth/navigator_bluetoothtest.cc", - "//brave/chromium_src/third_party/blink/renderer/modules/plugins/navigator_pluginstest.cc", "//brave/browser/autoplay/autoplay_permission_context_browsertest.cc", "//brave/browser/brave_content_browser_client_browsertest.cc", "//brave/browser/brave_features_browsertest.cc", diff --git a/test/data/navigatormimetypes.html b/test/data/navigatormimetypes.html deleted file mode 100644 index 7045499c817c..000000000000 --- a/test/data/navigatormimetypes.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/test/data/navigatormimetypeswithflash.html b/test/data/navigatormimetypeswithflash.html deleted file mode 100644 index 65c11084368b..000000000000 --- a/test/data/navigatormimetypeswithflash.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/test/data/navigatorplugins.html b/test/data/navigatorplugins.html deleted file mode 100644 index 59d8d0b53f38..000000000000 --- a/test/data/navigatorplugins.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/test/data/test.pdf b/test/data/test.pdf deleted file mode 100644 index 6da424d1f3fd..000000000000 Binary files a/test/data/test.pdf and /dev/null differ