summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebenginepage
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-05-04 10:02:55 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-05-04 10:03:08 +0200
commitc2f7f09974959c252a5e2879adfffe6356543fff (patch)
treee4cbe144c4f12387082541d1fef0e6b8b903d7cf /tests/auto/widgets/qwebenginepage
parentf58430945e302776e59fe107ae2eab1be76a9332 (diff)
parent662d721dbca23809e821b4d5945187c2969db9e2 (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Diffstat (limited to 'tests/auto/widgets/qwebenginepage')
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index e42af77c2..cc9b1838c 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ Copyright (C) 2016 The Qt Company Ltd.
Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
Copyright (C) 2010 Holger Hans Peter Freyther
@@ -236,6 +236,7 @@ private Q_SLOTS:
void restoreHistory();
void toPlainTextLoadFinishedRace_data();
void toPlainTextLoadFinishedRace();
+ void setZoomFactor();
void printToPdf();
@@ -4966,6 +4967,31 @@ void tst_QWebEnginePage::toPlainTextLoadFinishedRace()
QVERIFY(spy.count() == 3);
}
+void tst_QWebEnginePage::setZoomFactor()
+{
+ QWebEnginePage *page = new QWebEnginePage;
+
+ QVERIFY(qFuzzyCompare(page->zoomFactor(), 1.0));
+ page->setZoomFactor(2.5);
+ QVERIFY(qFuzzyCompare(page->zoomFactor(), 2.5));
+
+ const QUrl urlToLoad("qrc:/resources/test1.html");
+
+ QSignalSpy finishedSpy(m_page, SIGNAL(loadFinished(bool)));
+ m_page->setUrl(urlToLoad);
+ QTRY_COMPARE(finishedSpy.count(), 1);
+ QVERIFY(finishedSpy.at(0).first().toBool());
+ QVERIFY(qFuzzyCompare(page->zoomFactor(), 2.5));
+
+ page->setZoomFactor(5.5);
+ QVERIFY(qFuzzyCompare(page->zoomFactor(), 2.5));
+
+ page->setZoomFactor(0.1);
+ QVERIFY(qFuzzyCompare(page->zoomFactor(), 2.5));
+
+ delete page;
+}
+
void tst_QWebEnginePage::printToPdf()
{
QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX");