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

Unified Diff: chrome/browser/printing/print_preview_dialog_controller_browsertest.cc

Issue 2168453002: [HBD] Don't advertise Flash if Content Setting is on CONTENT_SETTING_BLOCK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compilation error Created 4 years, 5 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/printing/print_preview_dialog_controller_browsertest.cc
diff --git a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
index e9ad66b36c03c9f85a6a79558a90cca49d67bbcb..1e93654ee66db789a0be382fcff4f5ed873af3ad 100644
--- a/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
+++ b/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
@@ -7,6 +7,7 @@
#include <memory>
#include "base/bind_helpers.h"
+#include "base/files/file_path.h"
#include "base/location.h"
#include "base/macros.h"
#include "base/run_loop.h"
@@ -16,6 +17,7 @@
#include "build/build_config.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/plugins/plugin_prefs.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/task_management/mock_web_contents_task_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@@ -122,6 +124,11 @@ void PluginsLoadedCallback(
quit_closure.Run();
}
+void PluginEnabledCallback(const base::Closure& quit_closure, bool can_enable) {
+ EXPECT_TRUE(can_enable);
+ quit_closure.Run();
+}
+
bool GetPdfPluginInfo(content::WebPluginInfo* info) {
base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe(
ChromeContentClient::kPDFPluginPath);
@@ -285,8 +292,14 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
ASSERT_TRUE(GetPdfPluginInfo(&pdf_plugin_info));
// Disable the PDF plugin.
- PluginPrefs::GetForProfile(browser()->profile())->EnablePluginGroup(
- false, base::ASCIIToUTF16(ChromeContentClient::kPDFPluginName));
+ {
+ base::RunLoop run_loop;
+ PluginPrefs::GetForProfile(browser()->profile())->EnablePlugin(
+ false,
+ base::FilePath::FromUTF8Unsafe(ChromeContentClient::kPDFPluginPath),
+ base::Bind(&PluginEnabledCallback, run_loop.QuitClosure()));
+ run_loop.Run();
+ }
// Make sure it is actually disabled for webpages.
ChromePluginServiceFilter* filter = ChromePluginServiceFilter::GetInstance();
@@ -294,7 +307,7 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
EXPECT_FALSE(filter->IsPluginAvailable(
initiator()->GetRenderProcessHost()->GetID(),
initiator()->GetMainFrame()->GetRoutingID(),
- nullptr,
+ browser()->profile()->GetResourceContext(),
GURL("http://google.com"),
GURL(),
&dummy_pdf_plugin_info));
« no previous file with comments | « chrome/browser/plugins/chrome_plugin_service_filter.cc ('k') | chrome/browser/profiles/off_the_record_profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698