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

Unified Diff: chrome/renderer/printing/print_web_view_helper.cc

Issue 800343004: OOP PDF: Fix PrintWebViewHelper test issues with OOP PDF enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/printing/print_web_view_helper.cc
diff --git a/chrome/renderer/printing/print_web_view_helper.cc b/chrome/renderer/printing/print_web_view_helper.cc
index 892505fe344c908c7475e28034ba4cc838712b21..da209a297117515a0d6408159d6e7735633f7d5f 100644
--- a/chrome/renderer/printing/print_web_view_helper.cc
+++ b/chrome/renderer/printing/print_web_view_helper.cc
@@ -904,14 +904,13 @@ void PrintWebViewHelper::OnPrintForPrintPreview(
return;
}
- // The out-of-process plugin element is nested within a frame.
+ // The out-of-process plugin element is nested within a frame. In tests, there
+ // may not be an iframe containing the out-of-process plugin, so continue with
+ // 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 (switches::OutOfProcessPdfEnabled()) {
- if (!pdf_element.hasHTMLTagName("iframe")) {
- NOTREACHED();
- return;
- }
+ if (switches::OutOfProcessPdfEnabled() &&
+ pdf_element.hasHTMLTagName("iframe")) {
plugin_frame = blink::WebLocalFrame::fromFrameOwnerElement(pdf_element);
plugin_element = GetPdfElement(plugin_frame);
if (plugin_element.isNull()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698