Commit ecadfc25 authored by jocelyn.turcotte@digia.com's avatar jocelyn.turcotte@digia.com
Browse files

Fix tst_QQuickWebView::scrollRequest after r130029

https://bugs.webkit.org/show_bug.cgi?id=98045

Reviewed by Simon Hausmann.

The test needs to show the window and wait for the loadVisuallyCommitted()
signal like did in the QML API auto tests.

* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView::scrollRequest):
* UIProcess/API/qt/tests/util.cpp:
(waitForViewportReady):
* UIProcess/API/qt/tests/util.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d77d3bfe
2012-10-02 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Fix tst_QQuickWebView::scrollRequest after r130029
https://bugs.webkit.org/show_bug.cgi?id=98045
Reviewed by Simon Hausmann.
The test needs to show the window and wait for the loadVisuallyCommitted()
signal like did in the QML API auto tests.
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView::scrollRequest):
* UIProcess/API/qt/tests/util.cpp:
(waitForViewportReady):
* UIProcess/API/qt/tests/util.h:
2012-10-02 Jinwoo Song <jinwoo7.song@samsung.com>
 
[EFL][WK2] Use correct gtest macro for testing true/false
......
......@@ -440,10 +440,11 @@ void tst_QQuickWebView::inputMethodHints()
void tst_QQuickWebView::scrollRequest()
{
webView()->setSize(QSizeF(300, 400));
m_window->setGeometry(0, 0, 300, 400);
m_window->show();
webView()->setUrl(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/scroll.html")));
QVERIFY(waitForLoadSucceeded(webView()));
QVERIFY(waitForViewportReady(webView()));
// COMPARE with the position requested in the html
// Use qRound as that is also used when calculating the position
......
......@@ -126,6 +126,13 @@ bool waitForLoadFailed(QQuickWebView* webView, int timeout)
return timeoutSpy.isEmpty();
}
bool waitForViewportReady(QQuickWebView* webView, int timeout)
{
// The viewport is locked until the first frame of a page load is rendered.
// The QQuickView needs to be shown for this to succeed.
return waitForSignal(webView->experimental(), SIGNAL(loadVisuallyCommitted()), timeout);
}
LoadStartedCatcher::LoadStartedCatcher(QQuickWebView* webView)
: m_webView(webView)
{
......
......@@ -36,6 +36,7 @@ void suppressDebugOutput();
#if defined(HAVE_QTQUICK) && HAVE_QTQUICK
bool waitForLoadSucceeded(QQuickWebView* webView, int timeout = 10000);
bool waitForLoadFailed(QQuickWebView* webView, int timeout = 10000);
bool waitForViewportReady(QQuickWebView* webView, int timeout = 10000);
class LoadStartedCatcher : public QObject {
Q_OBJECT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment