TEST_F(WebPluginContainerTest, PrintOnePage) { URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("test.pdf"), WebString::fromUTF8("application/pdf")); TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper. FrameTestHelpers::WebViewHelper webViewHelper; WebView* webView = webViewHelper.initializeAndLoad(m_baseURL + "test.pdf", true, &pluginWebFrameClient); ASSERT(webView); webView->updateAllLifecyclePhases(); runPendingTasks(); WebFrame* frame = webView->mainFrame(); WebPrintParams printParams; printParams.printContentArea.width = 500; printParams.printContentArea.height = 500; frame->printBegin(printParams); SkPictureRecorder recorder; frame->printPage(0, recorder.beginRecording(IntRect())); frame->printEnd(); ASSERT(pluginWebFrameClient.printedAtLeastOnePage()); }