diff options
| author | Frank Reininghaus <[email protected]> | 2011-04-05 23:55:37 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2011-04-06 11:44:01 +0200 |
| commit | a9ecea7cd12e6d5cd8d9a10c9424ded4cc3ccdc7 (patch) | |
| tree | 05e048a1f82ba4f218a27a23655056e1e324decc /src/tests/dolphindetailsviewtest.cpp | |
| parent | 33635cd40c47c5710cd10a5fba878b35a89a5eb3 (diff) | |
Do not reload the DolphinView in the tests' initView() members
Rather than reloading the view after it is initilised, we just wait
until the view emits its finishedPathLoading() signal. This saves some
time when running the tests (at least on my system).
Diffstat (limited to 'src/tests/dolphindetailsviewtest.cpp')
| -rw-r--r-- | src/tests/dolphindetailsviewtest.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tests/dolphindetailsviewtest.cpp b/src/tests/dolphindetailsviewtest.cpp index d17341f6f..2aaf95e01 100644 --- a/src/tests/dolphindetailsviewtest.cpp +++ b/src/tests/dolphindetailsviewtest.cpp @@ -53,13 +53,24 @@ private: * Therefore, a pointer to the details view is returned by initView(DolphinView*). */ DolphinDetailsView* initView(DolphinView* view) const { + QSignalSpy spyFinishedPathLoading(view, SIGNAL(finishedPathLoading(const KUrl&))); view->setMode(DolphinView::DetailsView); DolphinDetailsView* detailsView = qobject_cast<DolphinDetailsView*>(itemView(view)); + Q_ASSERT(detailsView); detailsView->setFoldersExpandable(true); view->resize(400, 400); view->show(); QTest::qWaitForWindowShown(view); - reloadViewAndWait(view); + + // If the DolphinView's finishedPathLoading(const KUrl&) signal has not been received yet, + // we have to wait a bit more. + // The reason why the if-statement is needed here is that the signal might have been emitted + // while we were waiting in QTest::qWaitForWindowShown(view) + // -> waitForFinishedPathLoading(view) would fail in that case. + if (spyFinishedPathLoading.isEmpty()) { + Q_ASSERT(waitForFinishedPathLoading(view)); + } + return detailsView; } |
