From 07516c0811bf0ea02d1a8b4efc7ab7e9d63868f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 28 Apr 2021 15:57:15 +0200 Subject: Test at some Android DPIs in addition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø --- tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/auto/gui/kernel') 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>("dpiValues"); - QTest::newRow("96") << QList { 96, 96, 96 }; // standard-dpi sanity check - QTest::newRow("192") << QList { 192, 192, 192 }; // 2x high dpi - QTest::newRow("144-168-192") << QList { 144, 168, 192 }; // mixed dpi (1.5x, 1.75x, 2x) + // Standard-DPI sanity check + QTest::newRow("96") << QList { 96, 96, 96 }; + // 2x high DPI + QTest::newRow("192") << QList { 192, 192, 192 }; + // Mixed desktop DPI (1.5x, 1.75x, 2x) + QTest::newRow("144-168-192") << QList { 144, 168, 192 }; + // Densities from Android's DisplayMetrics docs, normalized to base 96 DPI + QTest::newRow("240-252-360") << QList { 400./160 * 96, 420./160 * 96, 600./160 * 96 }; } void tst_QHighDpi::cleanup() -- cgit v1.2.3