summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorraymes <raymes@chromium.org>2015-05-06 19:44:58 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-07 02:45:43 +0000
commitbe67c3d1a41734b948b91cb0b7d57a0ecb6ef389 (patch)
tree4d0ce02f05841f1b6b7c4c45eeadd4b95ebb8186
parent67314612a2fca488205d44b4d6911e2a29578539 (diff)
downloadchromium_src-be67c3d1a41734b948b91cb0b7d57a0ecb6ef389.zip
chromium_src-be67c3d1a41734b948b91cb0b7d57a0ecb6ef389.tar.gz
chromium_src-be67c3d1a41734b948b91cb0b7d57a0ecb6ef389.tar.bz2
Remove the OOP PDF flag
This removes the flag for enabling OOP PDF since it is enabled by default and the in process viewer no longer works anyway. The old in-process browser tests have been removed. They are mostly replaced by pdf_extension_test.cc and they are disabled anyway. BUG=483870,436444 Review URL: https://codereview.chromium.org/1128453003 Cr-Commit-Position: refs/heads/master@{#328687}
-rw-r--r--android_webview/renderer/aw_print_web_view_helper_delegate.cc4
-rw-r--r--android_webview/renderer/aw_print_web_view_helper_delegate.h1
-rw-r--r--chrome/browser/about_flags.cc8
-rw-r--r--chrome/browser/chrome_content_browser_client.cc2
-rw-r--r--chrome/browser/pdf/pdf_extension_test.cc5
-rw-r--r--chrome/browser/ui/BUILD.gn2
-rw-r--r--chrome/browser/ui/pdf/pdf_browsertest.cc219
-rw-r--r--chrome/browser/ui/pdf/pdf_browsertest_base.cc204
-rw-r--r--chrome/browser/ui/pdf/pdf_browsertest_base.h73
-rw-r--r--chrome/browser/ui/pdf/pdf_interactive_browsertest.cc49
-rw-r--r--chrome/chrome_tests.gypi2
-rw-r--r--chrome/chrome_tests_unit.gypi2
-rw-r--r--chrome/common/chrome_switches.cc18
-rw-r--r--chrome/common/chrome_switches.h3
-rw-r--r--chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc4
-rw-r--r--chrome/renderer/printing/chrome_print_web_view_helper_delegate.h2
-rw-r--r--components/printing/renderer/print_web_view_helper.cc3
-rw-r--r--components/printing/renderer/print_web_view_helper.h3
-rw-r--r--components/printing/test/print_test_content_renderer_client.cc1
19 files changed, 1 insertions, 604 deletions
diff --git a/android_webview/renderer/aw_print_web_view_helper_delegate.cc b/android_webview/renderer/aw_print_web_view_helper_delegate.cc
index 242cfdb..517766a 100644
--- a/android_webview/renderer/aw_print_web_view_helper_delegate.cc
+++ b/android_webview/renderer/aw_print_web_view_helper_delegate.cc
@@ -21,10 +21,6 @@ blink::WebElement AwPrintWebViewHelperDelegate::GetPdfElement(
return blink::WebElement();
}
-bool AwPrintWebViewHelperDelegate::IsOutOfProcessPdfEnabled() {
- return false;
-}
-
bool AwPrintWebViewHelperDelegate::IsPrintPreviewEnabled() {
return false;
}
diff --git a/android_webview/renderer/aw_print_web_view_helper_delegate.h b/android_webview/renderer/aw_print_web_view_helper_delegate.h
index e5a893c..6d9eac5 100644
--- a/android_webview/renderer/aw_print_web_view_helper_delegate.h
+++ b/android_webview/renderer/aw_print_web_view_helper_delegate.h
@@ -16,7 +16,6 @@ class AwPrintWebViewHelperDelegate
bool CancelPrerender(content::RenderView* render_view,
int routing_id) override;
blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) override;
- bool IsOutOfProcessPdfEnabled() override;
bool IsPrintPreviewEnabled() override;
bool IsAskPrintSettingsEnabled() override;
bool IsScriptedPrintEnabled() override;
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 201ebab..6acc4a3 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1891,14 +1891,6 @@ const Experiment kExperiments[] = {
switches::kDisableSessionCrashedBubble)
},
{
- "enable-out-of-process-pdf",
- IDS_FLAGS_OUT_OF_PROCESS_PDF_NAME,
- IDS_FLAGS_OUT_OF_PROCESS_PDF_DESCRIPTION,
- kOsDesktop,
- ENABLE_DISABLE_VALUE_TYPE(switches::kEnableOutOfProcessPdf,
- switches::kDisableOutOfProcessPdf)
- },
- {
"enable-pdf-material-ui",
IDS_FLAGS_PDF_MATERIAL_UI_NAME,
IDS_FLAGS_PDF_MATERIAL_UI_DESCRIPTION,
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 183dad8..eb8a373 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1367,7 +1367,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kDisableCastStreamingHWEncoding,
switches::kDisableJavaScriptHarmonyShipping,
switches::kDisableNewBookmarkApps,
- switches::kDisableOutOfProcessPdf,
switches::kEnableBenchmarking,
switches::kEnableNaCl,
#if !defined(DISABLE_NACL)
@@ -1377,7 +1376,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
#endif
switches::kEnableNetBenchmarking,
switches::kEnableNewBookmarkApps,
- switches::kEnableOutOfProcessPdf,
switches::kEnablePluginPlaceholderShadowDom,
switches::kJavaScriptHarmony,
switches::kMessageLoopHistogrammer,
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
index 36ef5bed..98fdea9 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -31,11 +31,6 @@ class PDFExtensionTest : public ExtensionApiTest,
public:
~PDFExtensionTest() override {}
- void SetUpCommandLine(base::CommandLine* command_line) override {
- ExtensionApiTest::SetUpCommandLine(command_line);
- command_line->AppendSwitch(switches::kEnableOutOfProcessPdf);
- }
-
void SetUpOnMainThread() override {
ExtensionApiTest::SetUpOnMainThread();
ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 2f6574b..0db45d8 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -486,8 +486,6 @@ source_set("test_support") {
"login/login_prompt_test_utils.h",
"passwords/manage_passwords_ui_controller_mock.cc",
"passwords/manage_passwords_ui_controller_mock.h",
- "pdf/pdf_browsertest_base.cc",
- "pdf/pdf_browsertest_base.h",
"test/test_confirm_bubble_model.cc",
"test/test_confirm_bubble_model.h",
"toolbar/test_toolbar_action_view_controller.cc",
diff --git a/chrome/browser/ui/pdf/pdf_browsertest.cc b/chrome/browser/ui/pdf/pdf_browsertest.cc
deleted file mode 100644
index 8d39960..0000000
--- a/chrome/browser/ui/pdf/pdf_browsertest.cc
+++ /dev/null
@@ -1,219 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/files/file_enumerator.h"
-#include "base/hash.h"
-#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/pdf/pdf_browsertest_base.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "content/public/browser/navigation_controller.h"
-#include "content/public/browser/notification_source.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/test/browser_test_utils.h"
-#include "third_party/WebKit/public/web/WebInputEvent.h"
-
-using content::NavigationController;
-using content::WebContents;
-
-// Note: All tests in here require the internal PDF plugin, so they're disabled
-// in non-official builds. We still compile them though, to prevent bitrot.
-
-namespace {
-
-// Tests basic PDF rendering. This can be broken depending on bad merges with
-// the vendor, so it's important that we have basic sanity checking.
-#if defined(GOOGLE_CHROME_BUILD) && defined(OS_LINUX)
-#define MAYBE_Basic DISABLED_Basic
-#else
-#define MAYBE_Basic DISABLED_Basic
-#endif
-IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Basic) {
- ASSERT_NO_FATAL_FAILURE(Load());
- ASSERT_NO_FATAL_FAILURE(WaitForResponse());
- // OS X uses CoreText, and FreeType renders slightly different on Linux and
- // Win.
-#if defined(OS_MACOSX)
- // The bots render differently than locally, see http://crbug.com/142531.
- ASSERT_TRUE(VerifySnapshot("pdf_browsertest_mac.png") ||
- VerifySnapshot("pdf_browsertest_mac2.png"));
-#elif defined(OS_LINUX)
- ASSERT_TRUE(VerifySnapshot("pdf_browsertest_linux.png"));
-#else
- ASSERT_TRUE(VerifySnapshot("pdf_browsertest.png"));
-#endif
-}
-
-#if defined(GOOGLE_CHROME_BUILD) && \
- (defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)))
-#define MAYBE_Scroll DISABLED_Scroll
-#else
-// TODO(thestig): http://crbug.com/79837, http://crbug.com/332778,
-// http://crbug.com/446221 Possibly a race between mouse event processing and
-// JavaScript execution in the renderer. The failure goes away if you Sleep()
-// after SwapBuffers.
-#define MAYBE_Scroll DISABLED_Scroll
-#endif
-// Tests that scrolling works.
-IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Scroll) {
- ASSERT_NO_FATAL_FAILURE(Load());
-
- // We use wheel mouse event since that's the only one we can easily push to
- // the renderer. There's no way to push a cross-platform keyboard event at
- // the moment.
- blink::WebMouseWheelEvent wheel_event;
- wheel_event.type = blink::WebInputEvent::MouseWheel;
- wheel_event.deltaY = -200;
- wheel_event.wheelTicksY = -2;
- WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
- web_contents->GetRenderViewHost()->ForwardWheelEvent(wheel_event);
- ASSERT_NO_FATAL_FAILURE(WaitForResponse());
-
- int y_offset = 0;
- ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
- browser()->tab_strip_model()->GetActiveWebContents(),
- "window.domAutomationController.send(plugin.pageYOffset())",
- &y_offset));
- ASSERT_GT(y_offset, 0);
-}
-
-const int kLoadingNumberOfParts = 10;
-
-// Tests that loading async pdfs works correctly (i.e. document fully loads).
-// This also loads all documents that used to crash, to ensure we don't have
-// regressions.
-// If it flakes, reopen http://crbug.com/74548.
-#if defined(GOOGLE_CHROME_BUILD)
-#define MAYBE_Loading DISABLED_Loading
-#else
-#define MAYBE_Loading DISABLED_Loading
-#endif
-IN_PROC_BROWSER_TEST_P(PDFBrowserTest, MAYBE_Loading) {
- ASSERT_TRUE(pdf_test_server()->InitializeAndWaitUntilReady());
-
- NavigationController* controller =
- &(browser()->tab_strip_model()->GetActiveWebContents()->GetController());
- content::NotificationRegistrar registrar;
- registrar.Add(this,
- content::NOTIFICATION_LOAD_STOP,
- content::Source<NavigationController>(controller));
- std::string base_url = std::string("/");
-
- base::FileEnumerator file_enumerator(
- ui_test_utils::GetTestFilePath(
- base::FilePath(FILE_PATH_LITERAL("pdf_private")), base::FilePath()),
- false,
- base::FileEnumerator::FILES,
- FILE_PATH_LITERAL("*.pdf"));
- for (base::FilePath file_path = file_enumerator.Next();
- !file_path.empty();
- file_path = file_enumerator.Next()) {
- std::string filename = file_path.BaseName().MaybeAsASCII();
- ASSERT_FALSE(filename.empty());
-
-#if defined(OS_POSIX)
- if (filename == "sample.pdf")
- continue; // Crashes on Mac and Linux. http://crbug.com/63549
-#endif
-
- // Split the test into smaller sub-tests. Each one only loads
- // every k-th file.
- if (static_cast<int>(base::Hash(filename) % kLoadingNumberOfParts) !=
- GetParam()) {
- continue;
- }
-
- LOG(WARNING) << "PDFBrowserTest.Loading: " << filename;
-
- GURL url = pdf_test_server()->GetURL(base_url + filename);
- ui_test_utils::NavigateToURL(browser(), url);
-
- while (true) {
- int last_count = load_stop_notification_count();
- // We might get extraneous chrome::LOAD_STOP notifications when
- // doing async loading. This happens when the first loader is cancelled
- // and before creating a byte-range request loader.
- bool complete = false;
- ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
- browser()->tab_strip_model()->GetActiveWebContents(),
- "window.domAutomationController.send(plugin.documentLoadComplete())",
- &complete));
- if (complete)
- break;
-
- // Check if the LOAD_STOP notification could have come while we run a
- // nested message loop for the JS call.
- if (last_count != load_stop_notification_count())
- continue;
- content::WaitForLoadStop(
- browser()->tab_strip_model()->GetActiveWebContents());
- }
- }
-}
-
-INSTANTIATE_TEST_CASE_P(PDFTestFiles,
- PDFBrowserTest,
- testing::Range(0, kLoadingNumberOfParts));
-
-#if defined(GOOGLE_CHROME_BUILD) && (defined(OS_WIN) || defined(OS_LINUX))
-#define MAYBE_Action DISABLED_Action
-#else
-// http://crbug.com/315160
-#define MAYBE_Action DISABLED_Action
-#endif
-IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_Action) {
- ASSERT_NO_FATAL_FAILURE(Load());
-
- ASSERT_TRUE(content::ExecuteScript(
- browser()->tab_strip_model()->GetActiveWebContents(),
- "document.getElementsByName('plugin')[0].fitToHeight();"));
-
- std::string zoom1, zoom2;
- ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- browser()->tab_strip_model()->GetActiveWebContents(),
- "window.domAutomationController.send("
- " document.getElementsByName('plugin')[0].getZoomLevel().toString())",
- &zoom1));
-
- ASSERT_TRUE(content::ExecuteScript(
- browser()->tab_strip_model()->GetActiveWebContents(),
- "document.getElementsByName('plugin')[0].fitToWidth();"));
-
- ASSERT_TRUE(content::ExecuteScriptAndExtractString(
- browser()->tab_strip_model()->GetActiveWebContents(),
- "window.domAutomationController.send("
- " document.getElementsByName('plugin')[0].getZoomLevel().toString())",
- &zoom2));
- ASSERT_NE(zoom1, zoom2);
-}
-
-#if defined(GOOGLE_CHROME_BUILD) && defined(OS_LINUX)
-#define MAYBE_OnLoadAndReload DISABLED_OnLoadAndReload
-#else
-// Flaky as per http://crbug.com/74549.
-#define MAYBE_OnLoadAndReload DISABLED_OnLoadAndReload
-#endif
-IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_OnLoadAndReload) {
- ASSERT_TRUE(pdf_test_server()->InitializeAndWaitUntilReady());
-
- GURL url = pdf_test_server()->GetURL("/onload_reload.html");
- ui_test_utils::NavigateToURL(browser(), url);
- WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();
-
- content::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- content::Source<NavigationController>(
- &contents->GetController()));
- ASSERT_TRUE(content::ExecuteScript(
- browser()->tab_strip_model()->GetActiveWebContents(),
- "reloadPDF();"));
- observer.Wait();
-
- ASSERT_EQ("success", contents->GetURL().query());
-}
-
-} // namespace
diff --git a/chrome/browser/ui/pdf/pdf_browsertest_base.cc b/chrome/browser/ui/pdf/pdf_browsertest_base.cc
deleted file mode 100644
index a230021..0000000
--- a/chrome/browser/ui/pdf/pdf_browsertest_base.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/pdf/pdf_browsertest_base.h"
-
-#include <algorithm>
-#include <vector>
-
-#include "base/command_line.h"
-#include "base/path_service.h"
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/chrome_paths.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/gfx/codec/png_codec.h"
-#include "ui/gfx/screen.h"
-
-#if defined(OS_LINUX)
-#include "content/public/common/content_switches.h"
-#endif
-
-#if defined(OS_CHROMEOS)
-#include "ui/compositor/compositor_switches.h"
-#endif
-
-namespace {
-
-// Include things like browser frame and scrollbar and make sure we're bigger
-// than the test pdf document.
-const int kBrowserWidth = 1000;
-const int kBrowserHeight = 600;
-
-} // namespace
-
-PDFBrowserTest::PDFBrowserTest()
- : snapshot_different_(true),
- next_dummy_search_value_(0),
- load_stop_notification_count_(0) {
- base::FilePath src_dir;
- EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir));
- pdf_test_server_.ServeFilesFromDirectory(src_dir.AppendASCII(
- "chrome/test/data/pdf_private"));
-}
-
-PDFBrowserTest::~PDFBrowserTest() {
-}
-
-void PDFBrowserTest::Load() {
- // Make sure to set the window size before rendering, as otherwise rendering
- // to a smaller window and then expanding leads to slight anti-aliasing
- // differences of the text and the pixel comparison fails.
- gfx::Rect bounds(gfx::Rect(0, 0, kBrowserWidth, kBrowserHeight));
- gfx::Rect screen_bounds =
- gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().bounds();
- ASSERT_GT(screen_bounds.width(), kBrowserWidth);
- ASSERT_GT(screen_bounds.height(), kBrowserHeight);
- browser()->window()->SetBounds(bounds);
-
- GURL url(ui_test_utils::GetTestUrl(
- base::FilePath(FILE_PATH_LITERAL("pdf_private")),
- base::FilePath(FILE_PATH_LITERAL("pdf_browsertest.pdf"))));
- ui_test_utils::NavigateToURL(browser(), url);
-}
-
-void PDFBrowserTest::WaitForResponse() {
- // Even if the plugin has loaded the data or scrolled, because of how
- // pepper painting works, we might not have the data. One way to force this
- // to be flushed is to do a find operation, since on this two-page test
- // document, it'll wait for us to flush the renderer message loop twice and
- // also the browser's once, at which point we're guaranteed to have updated
- // the backingstore. Hacky, but it works.
- // Note that we need to change the text each time, because if we don't the
- // renderer code will think the second message is to go to next result, but
- // there are none so the plugin will assert.
-
- base::string16 query = base::UTF8ToUTF16(
- std::string("xyzxyz" + base::IntToString(next_dummy_search_value_++)));
- ASSERT_EQ(0, ui_test_utils::FindInPage(
- browser()->tab_strip_model()->GetActiveWebContents(),
- query, true, false, NULL, NULL));
-}
-
-bool PDFBrowserTest::VerifySnapshot(const std::string& expected_filename) {
- snapshot_different_ = true;
- expected_filename_ = expected_filename;
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
- DCHECK(web_contents);
-
- content::RenderWidgetHost* rwh = web_contents->GetRenderViewHost();
- rwh->CopyFromBackingStore(
- gfx::Rect(),
- gfx::Size(),
- base::Bind(&PDFBrowserTest::CopyFromBackingStoreCallback, this),
- kN32_SkColorType);
-
- content::RunMessageLoop();
-
- if (snapshot_different_) {
- LOG(INFO) << "Rendering didn't match, see result "
- << snapshot_filename_.value();
- }
- return !snapshot_different_;
-}
-
-void PDFBrowserTest::CopyFromBackingStoreCallback(
- const SkBitmap& bitmap,
- content::ReadbackResponse response) {
- base::MessageLoopForUI::current()->Quit();
- ASSERT_EQ(response, content::READBACK_SUCCESS);
- base::FilePath reference = ui_test_utils::GetTestFilePath(
- base::FilePath(FILE_PATH_LITERAL("pdf_private")),
- base::FilePath().AppendASCII(expected_filename_));
- base::File::Info info;
- ASSERT_TRUE(base::GetFileInfo(reference, &info));
- int size = static_cast<size_t>(info.size);
- scoped_ptr<char[]> data(new char[size]);
- ASSERT_EQ(size, base::ReadFile(reference, data.get(), size));
-
- int w, h;
- std::vector<unsigned char> decoded;
- ASSERT_TRUE(gfx::PNGCodec::Decode(
- reinterpret_cast<unsigned char*>(data.get()), size,
- gfx::PNGCodec::FORMAT_BGRA, &decoded, &w, &h));
- int32* ref_pixels = reinterpret_cast<int32*>(&decoded[0]);
-
- SkAutoLockPixels lock_image(bitmap);
- int32* pixels = static_cast<int32*>(bitmap.getPixels());
-
- // Get the background color, and use it to figure out the x-offsets in
- // each image. The reason is that depending on the theme in the OS, the
- // same browser width can lead to slightly different plugin sizes, so the
- // pdf content will start at different x offsets.
- // Also note that the images we saved are cut off before the scrollbar, as
- // that'll change depending on the theme, and also cut off vertically so
- // that the ui controls don't show up, as those fade-in and so the timing
- // will affect their transparency.
- int32 bg_color = ref_pixels[0];
- int ref_x_offset, snapshot_x_offset;
- for (ref_x_offset = 0; ref_x_offset < w; ++ref_x_offset) {
- if (ref_pixels[ref_x_offset] != bg_color)
- break;
- }
-
- for (snapshot_x_offset = 0; snapshot_x_offset < bitmap.width();
- ++snapshot_x_offset) {
- if (pixels[snapshot_x_offset] != bg_color)
- break;
- }
-
- int x_max = std::min(w - ref_x_offset, bitmap.width() - snapshot_x_offset);
- int y_max = std::min(h, bitmap.height());
- int stride = bitmap.rowBytes();
- snapshot_different_ = false;
- for (int y = 0; y < y_max && !snapshot_different_; ++y) {
- for (int x = 0; x < x_max && !snapshot_different_; ++x) {
- if (pixels[y * stride / sizeof(int32) + x + snapshot_x_offset] !=
- ref_pixels[y * w + x + ref_x_offset])
- snapshot_different_ = true;
- }
- }
-
- if (snapshot_different_) {
- std::vector<unsigned char> png_data;
- gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &png_data);
- if (base::CreateTemporaryFile(&snapshot_filename_)) {
- base::WriteFile(snapshot_filename_,
- reinterpret_cast<char*>(&png_data[0]), png_data.size());
- }
- }
-}
-
-void PDFBrowserTest::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(content::NOTIFICATION_LOAD_STOP, type);
- load_stop_notification_count_++;
-}
-
-void PDFBrowserTest::SetUpCommandLine(base::CommandLine* command_line) {
- // Due to the changed architecture of the OOP PDF plugin, these tests don't
- // pass and need to be reworked. crbug.com/436444.
- command_line->AppendSwitch(switches::kDisableOutOfProcessPdf);
-
-#if defined(OS_LINUX)
- // Calling RenderWidgetHost::CopyFromBackingStore() with the GPU enabled
- // fails on Linux.
- command_line->AppendSwitch(switches::kDisableGpu);
-#endif
-
-#if defined(OS_CHROMEOS)
- // Also need on CrOS in addition to disabling the GPU above.
- command_line->AppendSwitch(switches::kUIDisableThreadedCompositing);
-#endif
-}
diff --git a/chrome/browser/ui/pdf/pdf_browsertest_base.h b/chrome/browser/ui/pdf/pdf_browsertest_base.h
deleted file mode 100644
index ee14467..0000000
--- a/chrome/browser/ui/pdf/pdf_browsertest_base.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_PDF_PDF_BROWSERTEST_BASE_H_
-#define CHROME_BROWSER_UI_PDF_PDF_BROWSERTEST_BASE_H_
-
-#include <string>
-
-#include "base/files/file_path.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/readback_types.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
-
-namespace base {
-class CommandLine;
-}
-
-class SkBitmap;
-
-// This class is in its own separate file because it is used in both
-// browser_tests and interactive_ui_tests.
-class PDFBrowserTest : public InProcessBrowserTest,
- public testing::WithParamInterface<int>,
- public content::NotificationObserver {
- public:
- PDFBrowserTest();
- ~PDFBrowserTest() override;
-
- protected:
- // Use our own TestServer so that we can serve files from the pdf directory.
- net::test_server::EmbeddedTestServer* pdf_test_server() {
- return &pdf_test_server_;
- }
-
- int load_stop_notification_count() const {
- return load_stop_notification_count_;
- }
-
- void Load();
- void WaitForResponse();
- bool VerifySnapshot(const std::string& expected_filename);
-
- private:
- void CopyFromBackingStoreCallback(const SkBitmap& bitmap,
- content::ReadbackResponse response);
-
- // content::NotificationObserver
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
- // InProcessBrowserTest
- void SetUpCommandLine(base::CommandLine* command_line) override;
-
- // True if the snapshot differed from the expected value.
- bool snapshot_different_;
- // Internal variable used to synchronize to the renderer.
- int next_dummy_search_value_;
- // The filename of the bitmap to compare the snapshot to.
- std::string expected_filename_;
- // If the snapshot is different, holds the location where it's saved.
- base::FilePath snapshot_filename_;
- // How many times we've seen chrome::LOAD_STOP.
- int load_stop_notification_count_;
-
- net::test_server::EmbeddedTestServer pdf_test_server_;
-
- DISALLOW_COPY_AND_ASSIGN(PDFBrowserTest);
-};
-
-#endif // CHROME_BROWSER_UI_PDF_PDF_BROWSERTEST_BASE_H_
diff --git a/chrome/browser/ui/pdf/pdf_interactive_browsertest.cc b/chrome/browser/ui/pdf/pdf_interactive_browsertest.cc
deleted file mode 100644
index 2022320..0000000
--- a/chrome/browser/ui/pdf/pdf_interactive_browsertest.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/pdf/pdf_browsertest_base.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "content/public/browser/web_contents.h"
-#include "ui/base/clipboard/clipboard.h"
-
-// Note: All tests in here require the internal PDF plugin, so they're disabled
-// in non-official builds. We still compile them though, to prevent bitrot.
-//
-// These tests are interactive because they access the clipboard.
-
-namespace {
-
-const char kSearchKeyword[] = "adipiscing";
-
-#if defined(GOOGLE_CHROME_BUILD) && (defined(OS_WIN) || defined(OS_LINUX))
-#define MAYBE_FindAndCopy DISABLED_FindAndCopy
-#else
-// TODO(thestig): http://crbug.com/79837, http://crbug.com/329912
-#define MAYBE_FindAndCopy DISABLED_FindAndCopy
-#endif
-IN_PROC_BROWSER_TEST_F(PDFBrowserTest, MAYBE_FindAndCopy) {
- ASSERT_NO_FATAL_FAILURE(Load());
- // Verifies that find in page works.
- ASSERT_EQ(3, ui_test_utils::FindInPage(
- browser()->tab_strip_model()->GetActiveWebContents(),
- base::ASCIIToUTF16(kSearchKeyword),
- true, false, NULL, NULL));
-
- // Verify that copying selected text works.
- ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
- // Reset the clipboard first.
- clipboard->Clear(ui::CLIPBOARD_TYPE_COPY_PASTE);
-
- browser()->tab_strip_model()->GetActiveWebContents()->Copy();
- ASSERT_NO_FATAL_FAILURE(WaitForResponse());
-
- std::string text;
- clipboard->ReadAsciiText(ui::CLIPBOARD_TYPE_COPY_PASTE, &text);
- EXPECT_EQ(kSearchKeyword, text);
-}
-
-} // namespace
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 7125fa7..c22620e 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -490,7 +490,6 @@
'browser/ui/native_window_tracker_browsertest.cc',
'browser/ui/panels/panel_extension_browsertest.cc',
'browser/ui/passwords/manage_passwords_test.cc',
- 'browser/ui/pdf/pdf_browsertest.cc',
'browser/ui/prefs/prefs_tab_helper_browsertest.cc',
'browser/ui/search/new_tab_page_interceptor_browsertest.cc',
'browser/ui/search_engines/search_engine_tab_helper_browsertest.cc',
@@ -962,7 +961,6 @@
'browser/ui/panels/test_panel_notification_observer.h',
'browser/ui/passwords/manage_passwords_test.cc',
'browser/ui/passwords/manage_passwords_test.h',
- 'browser/ui/pdf/pdf_interactive_browsertest.cc',
'browser/ui/search/instant_extended_interactive_uitest.cc',
'browser/ui/search/instant_extended_manual_interactive_uitest.cc',
'browser/ui/search/instant_test_utils.cc',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index e2b51a1..40ddb2a 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -1714,8 +1714,6 @@
'browser/ui/login/login_prompt_test_utils.h',
'browser/ui/passwords/manage_passwords_ui_controller_mock.cc',
'browser/ui/passwords/manage_passwords_ui_controller_mock.h',
- 'browser/ui/pdf/pdf_browsertest_base.cc',
- 'browser/ui/pdf/pdf_browsertest_base.h',
'browser/ui/test/test_confirm_bubble_model.cc',
'browser/ui/test/test_confirm_bubble_model.h',
'browser/ui/toolbar/test_toolbar_action_view_controller.cc',
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 105c618..476b22f 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -291,9 +291,6 @@ const char kDisableOfflineAutoReload[] = "disable-offline-auto-reload";
const char kDisableOfflineAutoReloadVisibleOnly[] =
"disable-offline-auto-reload-visible-only";
-// Disable the out of process PDF plugin.
-const char kDisableOutOfProcessPdf[] = "disable-out-of-process-pdf";
-
// Disable the setting to prompt the user for their OS account password before
// revealing plaintext passwords in the password manager.
const char kDisablePasswordManagerReauthentication[] =
@@ -483,9 +480,6 @@ const char kEnableOfflineAutoReload[] = "enable-offline-auto-reload";
const char kEnableOfflineAutoReloadVisibleOnly[] =
"enable-offline-auto-reload-visible-only";
-// Enable the out of process PDF plugin.
-const char kEnableOutOfProcessPdf[] = "enable-out-of-process-pdf";
-
// Enables panels (always on-top docked pop-up windows).
const char kEnablePanels[] = "enable-panels";
@@ -1367,18 +1361,6 @@ bool NewOfflineErrorPageEnabled() {
::switches::kDisableNewOfflineErrorPage);
}
-bool OutOfProcessPdfEnabled() {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnableOutOfProcessPdf))
- return true;
-
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- kDisableOutOfProcessPdf))
- return false;
-
- // Default.
- return true;
-}
-
bool PdfMaterialUIEnabled() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(kEnablePdfMaterialUI))
return true;
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 40f5551..1e64324 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -86,7 +86,6 @@ extern const char kDisableNewOfflineErrorPage[];
extern const char kDisableNTPOtherSessionsMenu[];
extern const char kDisableOfflineAutoReload[];
extern const char kDisableOfflineAutoReloadVisibleOnly[];
-extern const char kDisableOutOfProcessPdf[];
extern const char kDisablePasswordManagerReauthentication[];
extern const char kDisablePdfMaterialUI[];
extern const char kDisablePermissionsBubbles[];
@@ -140,7 +139,6 @@ extern const char kEnableNewBookmarkApps[];
extern const char kEnableNpnHttpOnly[];
extern const char kEnableOfflineAutoReload[];
extern const char kEnableOfflineAutoReloadVisibleOnly[];
-extern const char kEnableOutOfProcessPdf[];
extern const char kEnablePanels[];
extern const char kEnablePdfMaterialUI[];
extern const char kEnablePermissionsBubbles[];
@@ -400,7 +398,6 @@ bool AboutInSettingsEnabled();
bool MdSettingsEnabled();
bool MediaRouterEnabled();
bool NewOfflineErrorPageEnabled();
-bool OutOfProcessPdfEnabled();
bool PdfMaterialUIEnabled();
bool SettingsWindowEnabled();
diff --git a/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc
index 576bb15..c451c80 100644
--- a/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc
+++ b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.cc
@@ -55,10 +55,6 @@ blink::WebElement ChromePrintWebViewHelperDelegate::GetPdfElement(
return blink::WebElement();
}
-bool ChromePrintWebViewHelperDelegate::IsOutOfProcessPdfEnabled() {
- return switches::OutOfProcessPdfEnabled();
-}
-
bool ChromePrintWebViewHelperDelegate::IsPrintPreviewEnabled() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
return !command_line->HasSwitch(switches::kDisablePrintPreview);
diff --git a/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h
index d290b56..dae1ade 100644
--- a/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h
+++ b/chrome/renderer/printing/chrome_print_web_view_helper_delegate.h
@@ -17,8 +17,6 @@ class ChromePrintWebViewHelperDelegate
blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) override;
- bool IsOutOfProcessPdfEnabled() override;
-
bool IsPrintPreviewEnabled() override;
bool OverridePrint(blink::WebLocalFrame* frame) override;
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index cef7a95..97c0a96 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -904,8 +904,7 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
// the element with ID "pdf-viewer" if it isn't an iframe.
blink::WebLocalFrame* plugin_frame = pdf_element.document().frame();
blink::WebElement plugin_element = pdf_element;
- if (delegate_->IsOutOfProcessPdfEnabled() &&
- pdf_element.hasHTMLTagName("iframe")) {
+ if (pdf_element.hasHTMLTagName("iframe")) {
plugin_frame = blink::WebLocalFrame::fromFrameOwnerElement(pdf_element);
plugin_element = delegate_->GetPdfElement(plugin_frame);
if (plugin_element.isNull()) {
diff --git a/components/printing/renderer/print_web_view_helper.h b/components/printing/renderer/print_web_view_helper.h
index a4eea7b..28bdf68 100644
--- a/components/printing/renderer/print_web_view_helper.h
+++ b/components/printing/renderer/print_web_view_helper.h
@@ -94,9 +94,6 @@ class PrintWebViewHelper
// a pdf plugin element can't be extracted from the frame.
virtual blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) = 0;
- // Used to know whether the content to print could be nested in an iframe.
- virtual bool IsOutOfProcessPdfEnabled() = 0;
-
virtual bool IsPrintPreviewEnabled() = 0;
// If true, the user can be asked to provide print settings.
diff --git a/components/printing/test/print_test_content_renderer_client.cc b/components/printing/test/print_test_content_renderer_client.cc
index 0e8f427..b5947ce 100644
--- a/components/printing/test/print_test_content_renderer_client.cc
+++ b/components/printing/test/print_test_content_renderer_client.cc
@@ -20,7 +20,6 @@ class PrintWebViewHelperDelegate : public PrintWebViewHelper::Delegate {
blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) override {
return blink::WebElement();
}
- bool IsOutOfProcessPdfEnabled() override { return false; }
bool IsPrintPreviewEnabled() override {
#if defined(ENABLE_PRINT_PREVIEW)
return true;