summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-05 14:08:31 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-11 07:46:53 +0000
commit6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (patch)
treeab00f70a5e89278d6a0d16ff0c42578dc4d84a2d /chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
parente733310db58160074f574c429d48f8308c0afe17 (diff)
BASELINE: Update Chromium to 57.0.2987.144
Change-Id: I29db402ff696c71a04c4dbaec822c2e53efe0267 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc')
-rw-r--r--chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc23
1 files changed, 8 insertions, 15 deletions
diff --git a/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc b/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
index 598a121a912..335becff7f9 100644
--- a/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
+++ b/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
@@ -127,11 +127,6 @@ 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);
@@ -180,6 +175,11 @@ class PrintPreviewDialogControllerBrowserTest : public InProcessBrowserTest {
return dialog_controller->GetPrintPreviewForContents(initiator_);
}
+ void SetAlwaysOpenPdfExternallyForTests(bool always_open_pdf_externally) {
+ PluginPrefs::GetForProfile(browser()->profile())
+ ->SetAlwaysOpenPdfExternallyForTests(always_open_pdf_externally);
+ }
+
private:
void SetUpOnMainThread() override {
WebContents* first_tab =
@@ -292,14 +292,7 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
ASSERT_TRUE(GetPdfPluginInfo(&pdf_plugin_info));
// Disable the PDF plugin.
- {
- base::RunLoop run_loop;
- PluginPrefs::GetForProfile(browser()->profile())->EnablePlugin(
- false,
- base::FilePath::FromUTF8Unsafe(ChromeContentClient::kPDFPluginPath),
- base::Bind(&PluginEnabledCallback, run_loop.QuitClosure()));
- run_loop.Run();
- }
+ SetAlwaysOpenPdfExternallyForTests(true);
// Make sure it is actually disabled for webpages.
ChromePluginServiceFilter* filter = ChromePluginServiceFilter::GetInstance();
@@ -337,7 +330,7 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
preview_dialog->ForEachFrame(base::Bind(&CheckPdfPluginForRenderFrame));
}
-#if defined(ENABLE_TASK_MANAGER)
+#if !defined(OS_ANDROID)
namespace {
@@ -403,4 +396,4 @@ IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
} // namespace
-#endif // defined(ENABLE_TASK_MANAGER)
+#endif // !defined(OS_ANDROID)