From 1e5ac8c491381f2ef70df6383407e9cbe226b4b9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 21 Feb 2017 13:27:50 +0100 Subject: Catch terminating render process in file picker test These tests have been broken for some time but we didn't catch that the web-process self-terminated. This change ensures we catch it and adds the failing tests to the black list. It also fixes BLACKLIST support by following what QUICK_TEST_MAIN does. Change-Id: I31cc123e1d653f37e33ccb3a754b9fae8cfe02d6 Reviewed-by: Alexandru Croitor Reviewed-by: Peter Varga --- tests/auto/quick/qmltests/BLACKLIST | 8 ++++++++ tests/auto/quick/qmltests/data/tst_filePicker.qml | 14 ++++++++++++-- tests/auto/quick/qmltests/tst_qmltests.cpp | 4 ++++ 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST index dd8258ba4..5788ce25b 100644 --- a/tests/auto/quick/qmltests/BLACKLIST +++ b/tests/auto/quick/qmltests/BLACKLIST @@ -10,3 +10,11 @@ linux [DesktopWebEngineViewLinkHovered::test_linkHoveredDoesntEmitRepeated] linux +[WebEngineViewSingleFileUpload::test_acceptDirectory] +* + +[WebEngineViewSingleFileUpload::test_acceptMultipleFilesSelection] +* + +[WebEngineViewSingleFileUpload::test_acceptSingleFileSelection] +* diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml index 4e74af733..655789bb3 100644 --- a/tests/auto/quick/qmltests/data/tst_filePicker.qml +++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml @@ -41,6 +41,11 @@ TestWebEngineView { target: webEngineView signalName: "titleChanged" } + SignalSpy { + id: terminationSpy + target: webEngineView + signalName: "renderProcessTerminated" + } TestCase { name: "WebEngineViewSingleFileUpload" @@ -51,11 +56,16 @@ TestWebEngineView { FilePickerParams.selectFiles = false FilePickerParams.selectedFilesUrl = [] titleSpy.clear() + terminationSpy.clear() } - // FIXME: Almost every second url loading progress does get stuck at about 90 percent, so the loadFinished signal won't arrive. - // This cleanup function is a workaround for this problem. function cleanup() { + // Test that the render process doesn't crash, and make sure if it does it does so now. + wait(1000) + verify(terminationSpy.count == 0, "Render process didn't self terminate") + + // FIXME: Almost every second url loading progress does get stuck at about 90 percent, so the loadFinished signal won't arrive. + // This cleanup function is a workaround for this problem. webEngineView.url = Qt.resolvedUrl("about:blank") webEngineView.waitForLoadSucceeded() } diff --git a/tests/auto/quick/qmltests/tst_qmltests.cpp b/tests/auto/quick/qmltests/tst_qmltests.cpp index 6b5c4d00b..fa2f069f5 100644 --- a/tests/auto/quick/qmltests/tst_qmltests.cpp +++ b/tests/auto/quick/qmltests/tst_qmltests.cpp @@ -42,6 +42,10 @@ int main(int argc, char **argv) if (!QCoreApplication::instance()) app.reset(new Application(argc, argv)); QtWebEngine::initialize(); + + QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS + QTEST_SET_MAIN_SOURCE_PATH + int i = quick_test_main(argc, argv, "qmltests", QUICK_TEST_SOURCE_DIR); return i; } -- cgit v1.2.3