From c58d84c26106e48a368982d88c3cac47eec0ca54 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Tue, 5 Apr 2011 22:12:51 +0200 Subject: Add function TestBase::waitForFinishedPathLoading() Many tests have to wait until this signal is received from the DolphinView, so it is convenient to have a function that wraps the QTest::kWaitForSignal() call. --- src/tests/dolphinviewtest_allviewmodes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tests/dolphinviewtest_allviewmodes.cpp') diff --git a/src/tests/dolphinviewtest_allviewmodes.cpp b/src/tests/dolphinviewtest_allviewmodes.cpp index 77684984d..f357ce60c 100644 --- a/src/tests/dolphinviewtest_allviewmodes.cpp +++ b/src/tests/dolphinviewtest_allviewmodes.cpp @@ -198,7 +198,7 @@ void DolphinViewTest_AllViewModes::testViewPropertySettings() // Show hidden files. This triggers the dir lister // -> we have to wait until loading the hidden files is finished view.setShowHiddenFiles(true); - QVERIFY(QTest::kWaitForSignal(&view, SIGNAL(finishedPathLoading(const KUrl&)), 2000)); + QVERIFY(waitForFinishedPathLoading(&view)); QVERIFY(view.showHiddenFiles()); QCOMPARE(viewItems(&view), QStringList() << ".f" << "a" << "b" << "c" << "d" << "e"); @@ -324,12 +324,12 @@ void DolphinViewTest_AllViewModes::testSaveAndRestoreState() // Change the URL view.setUrl(dir.name() + "51"); - QVERIFY(QTest::kWaitForSignal(&view, SIGNAL(finishedPathLoading(const KUrl&)), 2000)); + QVERIFY(waitForFinishedPathLoading(&view)); qApp->sendPostedEvents(); // Go back, but do not call DolphinView::restoreState() view.setUrl(dir.url()); - QVERIFY(QTest::kWaitForSignal(&view, SIGNAL(finishedPathLoading(const KUrl&)), 2000)); + QVERIFY(waitForFinishedPathLoading(&view)); qApp->sendPostedEvents(); // Verify that the view is scrolled to top-left corner and that item 45 is not the current item. @@ -343,7 +343,7 @@ void DolphinViewTest_AllViewModes::testSaveAndRestoreState() // Change the URL again view.setUrl(dir.name() + "51"); - QVERIFY(QTest::kWaitForSignal(&view, SIGNAL(finishedPathLoading(const KUrl&)), 2000)); + QVERIFY(waitForFinishedPathLoading(&view)); qApp->sendPostedEvents(); // Check that the current item and scroll position are correct if DolphinView::restoreState() @@ -351,7 +351,7 @@ void DolphinViewTest_AllViewModes::testSaveAndRestoreState() view.setUrl(dir.url()); QDataStream restoreStream(viewState); view.restoreState(restoreStream); - QVERIFY(QTest::kWaitForSignal(&view, SIGNAL(finishedPathLoading(const KUrl&)), 2000)); + QVERIFY(waitForFinishedPathLoading(&view)); qApp->sendPostedEvents(); QCOMPARE(itemView(&view)->currentIndex(), index45); -- cgit v1.3