summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp')
-rw-r--r--WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp35
1 files changed, 4 insertions, 31 deletions
diff --git a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index 4bdb7f5..657e09f 100644
--- a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -17,36 +17,13 @@
Boston, MA 02110-1301, USA.
*/
+#include "../util.h"
#include <QtTest/QtTest>
-
#include <QGraphicsView>
#include <qgraphicswebview.h>
#include <qwebpage.h>
#include <qwebframe.h>
-/**
- * Starts an event loop that runs until the given signal is received.
- * Optionally the event loop
- * can return earlier on a timeout.
- *
- * \return \p true if the requested signal was received
- * \p false on timeout
- */
-static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
-{
- QEventLoop loop;
- QObject::connect(obj, signal, &loop, SLOT(quit()));
- QTimer timer;
- QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
- if (timeout > 0) {
- QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
- timer.setSingleShot(true);
- timer.start(timeout);
- }
- loop.exec();
- return timeoutSpy.isEmpty();
-}
-
class tst_QGraphicsWebView : public QObject
{
Q_OBJECT
@@ -63,21 +40,17 @@ void tst_QGraphicsWebView::qgraphicswebview()
item.title();
item.icon();
item.zoomFactor();
- item.isInteractive();
- item.progress();
- item.toHtml();
item.history();
item.settings();
- item.status();
item.page();
item.setPage(0);
item.page();
item.setUrl(QUrl());
item.setZoomFactor(0);
- item.setInteractive(true);
item.load(QUrl());
item.setHtml(QString());
item.setContent(QByteArray());
+ item.isModified();
}
class WebPage : public QWebPage
@@ -117,7 +90,7 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
view.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
view.resize(600, 480);
webView->resize(view.geometry().size());
- QTest::qWait(200);
+ QCoreApplication::processEvents();
view.show();
page->mainFrame()->setHtml(QString("data:text/html,"
@@ -126,7 +99,7 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages()
"<frame src=\"data:text/html,bar\">"
"</frameset>"));
- QVERIFY(::waitForSignal(page, SIGNAL(loadFinished(bool))));
+ QVERIFY(waitForSignal(page, SIGNAL(loadFinished(bool))));
}
QTEST_MAIN(tst_QGraphicsWebView)