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()) { |