DescriptionFix for race condition where print preview hangs when attempting to print a PDF that hasn't loaded.
If |type| in RequestPrintPreview() equals PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME and |is_loading_| is true, RequestPrintPreview() returns,
then is called again, right after |is_loading_| is set to false in DidStopLoading().
BUG=376969
TEST=See bug for steps to reproduce.
Additional way to reproduce:
Build blink_tests and browser_tests in out/Release. Then in src/webkit/tools/layout_tests run this command:
./run_webkit_tests.py --platform browser_test.linux source_pdf/
you can replace linux with win or mac depending on your platform.
The program will attempt to save a PDF as a PDF through print preview. It will eventually fail because Print Preview will hang due to this bug.
If you want visual confirmation that this will happen open:
src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver.py.
Then add this line of code to the function cmd_line.
cmd.append('--enable-pixel-output-in-tests')
Then run the script again. Enabling pixel output will also make it significantly more likely for the bug to occur.
Its also more likely to happen on windows for some reason.
This is how I came across the bug.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=287982
Patch Set 1 #Patch Set 2 : Fixed typo in comment and space issue. #Patch Set 3 : Moved |request_print_preview_closure_| into the switch statement. #
Total comments: 5
Patch Set 4 : Renamed closure. |on_stop_loading_closure_| now also calls ShowScriptedPrintPreview. #
Total comments: 9
Patch Set 5 : Removed NOTREACHED() in DidStopLoading(), moved the first bind statement and added another. #
Messages
Total messages: 17 (0 generated)
|