Skip to content

Commit

Permalink
2011-05-30 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Browse files Browse the repository at this point in the history
        Reviewed by Andreas Kling.

        [Qt] Fix unnecessary wait in API autotest tst_QWebFrame::scrollbarsOff
        https://bugs.webkit.org/show_bug.cgi?id=61711

        The loadFinished() signal was emitted directly inside the call for setHtml, so
        the test was waiting the loadFinished() signal with a big timeout. Change this by
        a very small timeout and a verification with signal spy.

        In practice, setHtml() will either directly call loadFinished() or queue it to
        the next event loop run, and test will work for both situations.

        * tests/qwebframe/tst_qwebframe.cpp:
        (tst_QWebFrame::scrollbarsOff):

Canonical link: https://commits.webkit.org/77178@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Caio Marcelo de Oliveira Filho committed May 30, 2011
1 parent f915429 commit bead867
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Source/WebKit/qt/ChangeLog
@@ -1,3 +1,20 @@
2011-05-30 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>

Reviewed by Andreas Kling.

[Qt] Fix unnecessary wait in API autotest tst_QWebFrame::scrollbarsOff
https://bugs.webkit.org/show_bug.cgi?id=61711

The loadFinished() signal was emitted directly inside the call for setHtml, so
the test was waiting the loadFinished() signal with a big timeout. Change this by
a very small timeout and a verification with signal spy.

In practice, setHtml() will either directly call loadFinished() or queue it to
the next event loop run, and test will work for both situations.

* tests/qwebframe/tst_qwebframe.cpp:
(tst_QWebFrame::scrollbarsOff):

2011-05-30 Noam Rosenthal <noam.rosenthal@nokia.com>

Reviewed by Kenneth Rohde Christiansen.
Expand Down
4 changes: 3 additions & 1 deletion Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
Expand Up @@ -3134,8 +3134,10 @@ void tst_QWebFrame::scrollbarsOff()
"</body>");


QSignalSpy loadSpy(&view, SIGNAL(loadFinished(bool)));
view.setHtml(html);
::waitForSignal(&view, SIGNAL(loadFinished(bool)));
::waitForSignal(&view, SIGNAL(loadFinished(bool)), 200);
QCOMPARE(loadSpy.count(), 1);

mainFrame->evaluateJavaScript("checkScrollbar();");
QCOMPARE(mainFrame->documentElement().findAll("span").at(0).toPlainText(), QString("SUCCESS"));
Expand Down

0 comments on commit bead867

Please sign in to comment.