diff options
author | David Faure <david.faure@kdab.com> | 2016-10-23 20:22:52 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2016-11-29 15:06:18 +0000 |
commit | c0950098f3a7d4994ff07b06b8ff32e2a60ee7bf (patch) | |
tree | 30a76adcebee0dd93d63420eab125c148bac1423 /tests/auto/core | |
parent | 01c029fd90162bdbbcf9534537f26138a333c570 (diff) |
Port autotests from own waitForSignal() to QSignalSpy::wait()
I added QSignalSpy::wait() in Qt 5.0 exactly for this purpose.
Change-Id: I895a92f5f7e4e8554e00f6668e6973cc2c903adf
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/core')
-rw-r--r-- | tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp index 180953ed4..89ebbac62 100644 --- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp +++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp @@ -192,21 +192,21 @@ void tst_QWebEngineUrlRequestInterceptor::requestedUrl() page.profile()->setRequestInterceptor(&interceptor); page.setUrl(QUrl("qrc:///resources/__placeholder__")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(spy.count(), 1); QCOMPARE(interceptor.observedUrls.at(0), QUrl("qrc:///resources/content.html")); QCOMPARE(page.requestedUrl(), QUrl("qrc:///resources/__placeholder__")); QCOMPARE(page.url(), QUrl("qrc:///resources/content.html")); page.setUrl(QUrl("qrc:/non-existent.html")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(spy.count(), 2); QCOMPARE(interceptor.observedUrls.at(2), QUrl("qrc:/non-existent.html")); QCOMPARE(page.requestedUrl(), QUrl("qrc:///resources/__placeholder__")); QCOMPARE(page.url(), QUrl("qrc:///resources/content.html")); page.setUrl(QUrl("http://abcdef.abcdef")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(spy.count(), 3); QCOMPARE(interceptor.observedUrls.at(3), QUrl("http://abcdef.abcdef/")); QCOMPARE(page.requestedUrl(), QUrl("qrc:///resources/__placeholder__")); @@ -222,23 +222,23 @@ void tst_QWebEngineUrlRequestInterceptor::setUrlSameUrl() QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); page.setUrl(QUrl("qrc:///resources/__placeholder__")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(page.url(), QUrl("qrc:///resources/content.html")); QCOMPARE(spy.count(), 1); page.setUrl(QUrl("qrc:///resources/__placeholder__")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(page.url(), QUrl("qrc:///resources/content.html")); QCOMPARE(spy.count(), 2); // Now a case without redirect. page.setUrl(QUrl("qrc:///resources/content.html")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(page.url(), QUrl("qrc:///resources/content.html")); QCOMPARE(spy.count(), 3); page.setUrl(QUrl("qrc:///resources/__placeholder__")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(page.url(), QUrl("qrc:///resources/content.html")); QCOMPARE(spy.count(), 4); } @@ -252,7 +252,7 @@ void tst_QWebEngineUrlRequestInterceptor::firstPartyUrl() QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); page.setUrl(QUrl("qrc:///resources/firstparty.html")); - waitForSignal(&page, SIGNAL(loadFinished(bool))); + QVERIFY(spy.wait()); QCOMPARE(interceptor.observedUrls.at(0), QUrl("qrc:///resources/firstparty.html")); QCOMPARE(interceptor.observedUrls.at(1), QUrl("qrc:///resources/content.html")); QCOMPARE(interceptor.firstPartyUrls.at(0), QUrl("qrc:///resources/firstparty.html")); |