diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-03-22 16:29:46 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2017-08-31 07:40:20 +0000 |
commit | 656b7fdd2d972946fe980f4089f5e9d01160dc68 (patch) | |
tree | 283251893c9afe456f1d3198de80bf099dd6afad /src/webengine/api/qquickwebenginetestsupport_p.h | |
parent | 2710c66f0c27874aa455be91a6c24c7fd7fa7523 (diff) |
Add auto tests for MultipleMouseClickHelper
Qt WebEngine implements a custom handler for multiple mouse clicks.
These tests are intended to test whether the mouse click events are
properly forwarded to the Chromium's RenderWidgetHost.
Custom mouse click test functions have been also added for the custom
mouse click handler.
Change-Id: Ifdc7d09f5e0f0f76c37e137e5743482bf3fb8abb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebenginetestsupport_p.h')
-rw-r--r-- | src/webengine/api/qquickwebenginetestsupport_p.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginetestsupport_p.h b/src/webengine/api/qquickwebenginetestsupport_p.h index a84d00307..b601fb47c 100644 --- a/src/webengine/api/qquickwebenginetestsupport_p.h +++ b/src/webengine/api/qquickwebenginetestsupport_p.h @@ -54,12 +54,14 @@ #include <private/qinputmethod_p.h> #include <private/qtwebengineglobal_p.h> +#include <QEvent> #include <QObject> #include <QUrl> QT_BEGIN_NAMESPACE class QQuickWebEngineLoadRequest; +class QWindow; class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineErrorPage : public QObject { Q_OBJECT @@ -92,15 +94,31 @@ private: bool m_visible; }; +class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTestEvent : public QObject { + Q_OBJECT + +public: + QQuickWebEngineTestEvent(); + +public Q_SLOTS: + bool mouseMultiClick(QObject *item, qreal x, qreal y, int clickCount); + +private: + QWindow *eventWindow(QObject *item = 0); + void mouseEvent(QEvent::Type type, QWindow *window, QObject *item, const QPointF &_pos); +}; + class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineTestSupport : public QObject { Q_OBJECT Q_PROPERTY(QQuickWebEngineErrorPage *errorPage READ errorPage CONSTANT FINAL) Q_PROPERTY(QQuickWebEngineTestInputContext *testInputContext READ testInputContext CONSTANT FINAL) + Q_PROPERTY(QQuickWebEngineTestEvent *testEvent READ testEvent CONSTANT FINAL) public: QQuickWebEngineTestSupport(); QQuickWebEngineErrorPage *errorPage() const; QQuickWebEngineTestInputContext *testInputContext() const; + QQuickWebEngineTestEvent *testEvent() const; Q_SIGNALS: void windowCloseRejected(); @@ -109,6 +127,7 @@ Q_SIGNALS: private: QScopedPointer<QQuickWebEngineErrorPage> m_errorPage; QScopedPointer<QQuickWebEngineTestInputContext> m_testInputContext; + QScopedPointer<QQuickWebEngineTestEvent> m_testEvent; }; QT_END_NAMESPACE |