summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qmltests/data
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2018-05-17 12:50:28 +0200
committerKai Koehne <kai.koehne@qt.io>2018-06-25 09:13:27 +0000
commit8d752cab84d437244ef0c2318b70d6516e99a044 (patch)
treeaebef0826181330442d7075744be2d0dcbf1d251 /tests/auto/quick/qmltests/data
parent5fe78f9ef2d093cccfb52f810416dc5fb56d97fa (diff)
Make tests work on high-dpi screens
Change-Id: I89c39ccf6fd383cad33639959a90b7592467edac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests/data')
-rw-r--r--tests/auto/quick/qmltests/data/tst_favicon.qml5
-rw-r--r--tests/auto/quick/qmltests/data/tst_scrollPosition.qml7
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml
index 6f8adeb67..0aa8f0bb8 100644
--- a/tests/auto/quick/qmltests/data/tst_favicon.qml
+++ b/tests/auto/quick/qmltests/data/tst_favicon.qml
@@ -30,6 +30,7 @@ import QtQuick 2.0
import QtTest 1.0
import QtWebEngine 1.3
import QtWebEngine.testsupport 1.0
+import QtQuick.Window 2.0
TestWebEngineView {
id: webEngineView
@@ -323,8 +324,8 @@ TestWebEngineView {
iconChangedSpy.wait()
compare(iconChangedSpy.count, 1)
- faviconImage.width = row.size
- faviconImage.height = row.size
+ faviconImage.width = row.size / Screen.devicePixelRatio
+ faviconImage.height = row.size / Screen.devicePixelRatio
faviconImage.source = webEngineView.icon
var pixel = getFaviconPixel(faviconImage);
diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
index 55b71189d..24b352dde 100644
--- a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
+++ b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
@@ -27,6 +27,7 @@
****************************************************************************/
import QtQuick 2.2
+import QtQuick.Window 2.0
import QtTest 1.0
import QtWebEngine 1.3
@@ -60,7 +61,7 @@ TestWebEngineView {
tryCompare(scrollPositionSpy, "count", 1);
compare(webEngineView.scrollPosition.x, 0);
- compare(webEngineView.scrollPosition.y, 600);
+ compare(webEngineView.scrollPosition.y, 600 * Screen.devicePixelRatio);
}
function test_scrollPositionAfterReload() {
@@ -73,13 +74,13 @@ TestWebEngineView {
// Wait for proper scroll position change otherwise we cannot expect
// the new y position after reload.
tryCompare(webEngineView.scrollPosition, "x", 0);
- tryCompare(webEngineView.scrollPosition, "y", 600);
+ tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio);
webEngineView.reload();
verify(webEngineView.waitForLoadSucceeded());
tryCompare(webEngineView.scrollPosition, "x", 0);
- tryCompare(webEngineView.scrollPosition, "y", 600);
+ tryCompare(webEngineView.scrollPosition, "y", 600 * Screen.devicePixelRatio);
}
}
}