#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include <memory>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "build/build_config.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/test_print_preview_dialog_cloned_observer.h"
#include "chrome/browser/printing/test_print_view_manager_for_request_preview.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/task_manager/mock_web_contents_task_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/webplugininfo.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/scoped_accessibility_mode_override.h"
#include "content/public/test/test_utils.h"
#include "ipc/ipc_message_macros.h"
#include "ui/accessibility/ax_mode.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_switches.h"
#include "url/gurl.h"
WebContents;
WebContentsObserver;
namespace {
void PluginsLoadedCallback(
base::OnceClosure quit_closure,
const std::vector<content::WebPluginInfo>& ) { … }
void CheckPdfPluginForRenderFrame(content::RenderFrameHost* frame) { … }
}
class PrintPreviewDialogControllerBrowserTest : public InProcessBrowserTest { … };
#if BUILDFLAG(IS_MAC)
#define MAYBE_NavigateFromInitiatorTab …
#else
#define MAYBE_NavigateFromInitiatorTab …
#endif
IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
MAYBE_NavigateFromInitiatorTab) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_ReloadInitiatorTab …
#else
#define MAYBE_ReloadInitiatorTab …
#endif
IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
MAYBE_ReloadInitiatorTab) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_PdfPluginDisabled …
#else
#define MAYBE_PdfPluginDisabled …
#endif
IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
MAYBE_PdfPluginDisabled) { … }
namespace {
std::u16string GetExpectedPrefix() { … }
const std::vector<raw_ptr<task_manager::WebContentsTag, VectorExperimental>>&
GetTrackedTags() { … }
}
#if BUILDFLAG(IS_MAC)
#define MAYBE_TaskManagementTest …
#else
#define MAYBE_TaskManagementTest …
#endif
IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
MAYBE_TaskManagementTest) { … }
IN_PROC_BROWSER_TEST_F(PrintPreviewDialogControllerBrowserTest,
PrintPreviewPdfAccessibility) { … }