summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwebengineview
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickwebengineview')
-rw-r--r--tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index a1900a77d..60e495137 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -60,6 +60,7 @@ private Q_SLOTS:
void inputMethod();
void inputMethodHints();
void basicRenderingSanity();
+ void setZoomFactor();
private:
inline QQuickWebEngineView *newWebEngineView();
@@ -461,5 +462,24 @@ void tst_QQuickWebEngineView::inputMethodHints()
#endif
}
+void tst_QQuickWebEngineView::setZoomFactor()
+{
+ QQuickWebEngineView *view = webEngineView();
+
+ QVERIFY(qFuzzyCompare(view->zoomFactor(), 1.0));
+ view->setZoomFactor(2.5);
+ QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+
+ view->setUrl(urlFromTestPath("html/basic_page.html"));
+ QVERIFY(waitForLoadSucceeded(view));
+ QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+
+ view->setZoomFactor(0.1);
+ QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+
+ view->setZoomFactor(5.5);
+ QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
+}
+
QTEST_MAIN(tst_QQuickWebEngineView)
#include "tst_qquickwebengineview.moc"