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>
bb10
Morten Johan Sørvig 2021-04-28 15:57:15 +02:00
parent 5882131592
commit 07516c0811
1 changed files with 9 additions and 4 deletions

View File

@ -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()