[GTK] UI process crashes when the web process crashes while printing
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2014 07:47:47 +0000 (07:47 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jan 2014 07:47:47 +0000 (07:47 +0000)
commit0278b9c5022a9ada2eb492c95163b1d5065be436
treee2a0be3be0315aeb3bac0823ad6850cdf6c2bce9
parent16353c093c086f3b534a446e056aa763efb1296f
[GTK] UI process crashes when the web process crashes while printing
https://bugs.webkit.org/show_bug.cgi?id=126977

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:

When the web process crashes, the printing callback is
invalidated, so the function is called with a NULL error.

* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(drawPagesForPrintingCompleted): Check wkError is not NULL before
trying to use it.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewPrintFrame): Set the print mode of the operation
before emitting the print signal.

Tools:

Add new test case to check that closing the window right after
printing works. It's skipped for now, because this patch only
fixes the UI process crash, but not the web process one.

* Scripts/run-gtk-tests:
(TestRunner): Skip
/webkit2/WebKitPrintOperation/close-after-print.
* TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp:
(testPrintOperationPrintPrinter):
(findPrintToFilePrinter):
(testPrintOperationPrint):
(testPrintOperationErrors):
(testPrintOperationCloseAfterPrint):
(beforeAll):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitPrintOperation.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Tools/ChangeLog
Tools/Scripts/run-gtk-tests
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestPrinting.cpp