From 92a28473afb97ee50332f6fe81960c7241ca82d5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 16 Jun 2016 11:34:07 +0200 Subject: Stabilize FilePicker QML autotests Switch from timed wait to using tryCompare. Task-number: QTBUG-53777 Change-Id: I845fb8ee7b84641bd23314794512960634423d54 Reviewed-by: Joerg Bornemann --- tests/auto/quick/qmltests/data/tst_filePicker.qml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'tests/auto/quick/qmltests/data/tst_filePicker.qml') diff --git a/tests/auto/quick/qmltests/data/tst_filePicker.qml b/tests/auto/quick/qmltests/data/tst_filePicker.qml index 02b2dd024..f9c50c4e8 100644 --- a/tests/auto/quick/qmltests/data/tst_filePicker.qml +++ b/tests/auto/quick/qmltests/data/tst_filePicker.qml @@ -81,10 +81,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test1.html")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) // The ui delegate is invoked asynchronously - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "test1.html") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "test1.html") } function test_acceptMultipleFilesSelection() { @@ -96,10 +94,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("test2.html")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "test1.html,test2.html") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "test1.html,test2.html") } function test_acceptDirectory() { @@ -110,10 +106,8 @@ TestWebEngineView { FilePickerParams.selectedFilesUrl.push(Qt.resolvedUrl("../data")) keyPress(Qt.Key_Enter) // Focus is on the button. Open FileDialog. - wait(100) // The ui delegate is invoked asynchronously - verify(FilePickerParams.filePickerOpened) - titleSpy.wait() - compare(webEngineView.title, "data") + tryCompare(FilePickerParams, "filePickerOpened", true) + tryCompare(webEngineView, "title", "data") } function test_reject() { -- cgit v1.2.3