summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwebengineview
diff options
context:
space:
mode:
authorMichael Bruning <michael.bruning@theqtcompany.com>2016-04-15 17:37:04 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-21 07:17:03 +0000
commitd236c5a8a34803bda6115956184398b99dbba408 (patch)
tree5f340555e143fd250db747777180207ee1124dd8 /tests/auto/quick/qquickwebengineview
parent653bf0fa7081505273da5296b8dee8dfb594005c (diff)
Use the temporary zoom factor to set the zoom factor
It turns out that using the temporary zoom factor is meant to set the zoom factor for one certain view, and this is actually what we want. Also added auto tests for this. Task-number: QTBUG-51851 Task-number: QTBUG-51969 Change-Id: I8912cbc25637d3c1681026380a2ab3068a964868 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
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"