]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/dolphindetailsviewtest.cpp
Add function TestBase::waitForFinishedPathLoading()
[dolphin.git] / src / tests / dolphindetailsviewtest.cpp
index 87a9d253db1693a1a67d779bb8670eb5599db74e..d17341f6ffe386465d2e8ebd60e426b9534a9e7f 100644 (file)
@@ -98,11 +98,6 @@ void DolphinDetailsViewTest::testExpandedUrls()
     QSet<KUrl> 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()