RESOLVED FIXED 66016
[Qt] Add test for correct order of load signals in QWebPage
https://bugs.webkit.org/show_bug.cgi?id=66016
Summary [Qt] Add test for correct order of load signals in QWebPage
Caio Marcelo de Oliveira Filho
Reported 2011-08-10 15:25:53 PDT
[Qt] Add test for correct order of loadProgress() and loadFinished() signals
Attachments
Patch (3.28 KB, patch)
2011-08-10 15:27 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (3.22 KB, patch)
2011-08-10 15:41 PDT, Caio Marcelo de Oliveira Filho
no flags
Patch (3.82 KB, patch)
2011-08-11 13:25 PDT, Caio Marcelo de Oliveira Filho
benjamin: review+
Caio Marcelo de Oliveira Filho
Comment 1 2011-08-10 15:27:10 PDT
Luiz Agostini
Comment 2 2011-08-10 15:31:51 PDT
Comment on attachment 103541 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=103541&action=review > Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp:3178 > + QSignalSpy(&page, SIGNAL(loadFinished(bool))); Is it needed?
Caio Marcelo de Oliveira Filho
Comment 3 2011-08-10 15:41:16 PDT
Benjamin Poulain
Comment 4 2011-08-11 10:21:13 PDT
Comment on attachment 103543 [details] Patch For the sake of code coverage, could you ensure loadStarted() is also send before loadProgress()? +page.mainFrame()->load(QUrl("data:text/html,This is first page")); This is a special case. I would like another load() with a local URL.
Caio Marcelo de Oliveira Filho
Comment 5 2011-08-11 13:25:29 PDT
Benjamin Poulain
Comment 6 2011-08-11 13:45:07 PDT
Comment on attachment 103661 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=103661&action=review Great patch. > Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp:3151 > + SpyForLoadSignalsOrder(QWebPage* page) > + : QStateMachine(page) This is setting the parent of the QStateMachine to page. I think they should be two separate things: SpyForLoadSignalsOrder(QWebPage* page, QObject* parent= 0); This is because I am not a fan of: SpyForLoadSignalsOrder loadSpy(&page); (parenting something on the stack by a QObject on the stack) > Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp:3195 > + if (loadSpy.isRunning()) > + QVERIFY(waitForSignal(&loadSpy, SIGNAL(finished()))); May I suggest to add QVERIFY(loadSpy.isComplete()); after the if() {} ? The isComplete() would just return !isRunning(); This is totally superfluous, your test is already correct. But I think that would make it easier for people to read the test. If someone read the test without knowing anything about how SpyForLoadSignalsOrder works, she will think: the QVERIFY is in a branch, it is probably wrong because loadSpy could have finished before the if().
Caio Marcelo de Oliveira Filho
Comment 7 2011-08-12 08:16:14 PDT
Ademar Reis
Comment 8 2011-09-05 09:41:40 PDT
Revision r92963 cherry-picked into qtwebkit-2.2 with commit 85204c9 <http://gitorious.org/webkit/qtwebkit/commit/85204c9>
Note You need to log in before you can comment on or make changes to this bug.