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/dolphindetailsviewtest.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/tests/dolphindetailsviewtest.cpp') diff --git a/src/tests/dolphindetailsviewtest.cpp b/src/tests/dolphindetailsviewtest.cpp index 87a9d253d..d17341f6f 100644 --- a/src/tests/dolphindetailsviewtest.cpp +++ b/src/tests/dolphindetailsviewtest.cpp @@ -98,11 +98,6 @@ void DolphinDetailsViewTest::testExpandedUrls() QSet expectedExpandedUrls; QCOMPARE(detailsView->expandedUrls(), expectedExpandedUrls); - // Every time we expand a folder, we have to wait until the view has finished loading - // its contents before we can expand further subfolders. We keep track of the reloading - // using a signal spy. - QSignalSpy spyFinishedPathLoading(&view, SIGNAL(finishedPathLoading(const KUrl&))); - // Expand URLs one by one and verify the result of DolphinDetailsView::expandedUrls() QStringList itemsToExpand; itemsToExpand << "b" << "b/a" << "b/a/c" << "b/c" << "c"; @@ -115,10 +110,7 @@ void DolphinDetailsViewTest::testExpandedUrls() // Before we proceed, we have to make sure that the view has finished // loading the contents of the expanded folder. - while (spyFinishedPathLoading.isEmpty()) { - QTest::qWait(10); - } - spyFinishedPathLoading.takeFirst(); + QVERIFY(waitForFinishedPathLoading(&view)); } // Collapse URLs one by one and verify the result of DolphinDetailsView::expandedUrls() -- cgit v1.3