summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2021-04-28 15:57:15 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2021-05-04 16:21:48 +0200
commit07516c0811bf0ea02d1a8b4efc7ab7e9d63868f0 (patch)
tree48742531adb58bedfaba6f4dd0d21e9354c7e942 /tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp
parent588213159208c6eabe660cf44569104eb5e0212d (diff)
Test at some Android DPIs in addition
Currently, we test at 1x, 2x, and mixed typical desktop DPI values. Add android DPI values, with scale factors in the 2.5 - 3.75 range. This test currently uses 96 as the base DPI (and so does the Android platform plugin), so we normalize the values to use that base DPI. Change-Id: I25b66f5e16d37c01758d5623b805e4141247a74a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp')
-rw-r--r--tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp b/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp
index c33d182f0b..f0b1cab41a 100644
--- a/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp
+++ b/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp
@@ -166,11 +166,16 @@ QGuiApplication *tst_QHighDpi::createStandardOffscreenApp(const QJsonArray &scre
void tst_QHighDpi::standardScreenDpiTestData()
{
- // We run each test under three screen configurations (each with three screens):
+ // We run each test under different DPI configurations, each with three screens:
QTest::addColumn<QList<qreal>>("dpiValues");
- QTest::newRow("96") << QList<qreal> { 96, 96, 96 }; // standard-dpi sanity check
- QTest::newRow("192") << QList<qreal> { 192, 192, 192 }; // 2x high dpi
- QTest::newRow("144-168-192") << QList<qreal> { 144, 168, 192 }; // mixed dpi (1.5x, 1.75x, 2x)
+ // Standard-DPI sanity check
+ QTest::newRow("96") << QList<qreal> { 96, 96, 96 };
+ // 2x high DPI
+ QTest::newRow("192") << QList<qreal> { 192, 192, 192 };
+ // Mixed desktop DPI (1.5x, 1.75x, 2x)
+ QTest::newRow("144-168-192") << QList<qreal> { 144, 168, 192 };
+ // Densities from Android's DisplayMetrics docs, normalized to base 96 DPI
+ QTest::newRow("240-252-360") << QList<qreal> { 400./160 * 96, 420./160 * 96, 600./160 * 96 };
}
void tst_QHighDpi::cleanup()