From d20bacbb4cedf012566ce0020f9e53a7c1ecbe5f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Sep 2019 09:12:17 +0200 Subject: tst_QWidget::translucentWidget(): Pass with High DPI scaling enabled Since 9c8d1ca18b48dbcc89dda1b9bacdf7d49c7fc754, the test would fail when High DPI scaling is enabled: FAIL! : tst_QWidget::translucentWidget() Compared QImages differ in device pixel ratio. Actual (actual): 2 Expected (expected): 1 .\tst_qwidget.cpp(8913) : failure location Set the device pixel ratio on the expected pixmap to fix this. Change-Id: I517495931c2c6b1f49125bb4b5836e304bdbf545 Reviewed-by: Oliver Wolff --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 1724d3ce8c..3e372b76f5 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -8906,7 +8906,8 @@ void tst_QWidget::translucentWidget() widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size())); #endif const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32); - const QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size()); + QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size()); + expected.setDevicePixelRatio(label.devicePixelRatioF()); if (m_platform == QStringLiteral("winrt")) QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort); QCOMPARE(actual.size(),expected.size()); -- cgit v1.2.3 From 7f0faddf9fe25adc0a3e0827e21c030d6a7a1035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 12 Sep 2019 15:52:06 +0200 Subject: CoreText: Modernize style hint fallback lookup The DefaultFontFallbacks.plist system file that we used for looking up style fallbacks does not exists in macOS 10.15, nor did it ever exists on iOS. Instead of relying on this file, we hard-code a set of default families, that we then look up the fallbacks for. The result of QFont::defaultFamily() on macOS is now: QFont::Helvetica --> "Helvetica" QFont::Times --> "Times New Roman" QFont::Courier --> "American Typewriter" QFont::OldEnglish --> "" QFont::System --> "Lucida Grande" QFont::AnyStyle --> "Lucida Grande" QFont::Cursive --> "Apple Chancery" QFont::Monospace --> "Menlo" QFont::Fantasy --> "Zapfino" And on iOS: QFont::Helvetica --> "Helvetica" QFont::Times --> "Times New Roman" QFont::Courier --> "American Typewriter" QFont::OldEnglish --> "" QFont::System --> "Helvetica" QFont::AnyStyle --> "Helvetica" QFont::Cursive --> "" QFont::Monospace --> "Menlo" QFont::Fantasy --> "Zapfino" Fixes: QTBUG-78240 Change-Id: Ie9bc13c9c1031d89f024199e4736a046c568a48d Reviewed-by: Simon Hausmann --- tests/auto/gui/text/qfont/tst_qfont.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 96f3b1c1d7..1ee9105cd2 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -539,10 +539,10 @@ void tst_QFont::defaultFamily_data() QTest::addColumn("acceptableFamilies"); QTest::newRow("serif") << QFont::Serif << (QStringList() << "Times New Roman" << "Times" << "Droid Serif" << getPlatformGenericFont("serif").split(",")); - QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << "Droid Sans Mono" << getPlatformGenericFont("monospace").split(",")); + QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << "Menlo" << "Droid Sans Mono" << getPlatformGenericFont("monospace").split(",")); QTest::newRow("cursive") << QFont::Cursive << (QStringList() << "Comic Sans MS" << "Apple Chancery" << "Roboto" << "Droid Sans" << getPlatformGenericFont("cursive").split(",")); QTest::newRow("fantasy") << QFont::Fantasy << (QStringList() << "Impact" << "Zapfino" << "Roboto" << "Droid Sans" << getPlatformGenericFont("fantasy").split(",")); - QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Roboto" << "Droid Sans" << "Segoe UI" << getPlatformGenericFont("sans-serif").split(",")); + QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Helvetica" << "Roboto" << "Droid Sans" << "Segoe UI" << getPlatformGenericFont("sans-serif").split(",")); } void tst_QFont::defaultFamily() -- cgit v1.2.3 From 6cee284001adf9da42b347a074cbff3cb92621b2 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 10 Sep 2019 16:39:43 +0200 Subject: Fix mis-handling of actual TLD in qIsEffectiveTLD() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the domain passed down is an actual TLD that's the subject of a * rule, e.g. "ck" subject to *.ck, then we were finding no dot in it and concluding that it couldn't be the subject of a * rule. Added a test for the specific .ck case and commented on where we could get some canonical test data that I tripped over while researching this. Cross-reference the cookie-jar test from the QUrl test, too. Fixes: QTBUG-78097 Change-Id: Id858a9dae22e6b306a68df3fc199e0160f537159 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 7 +++++++ .../network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 3123c42326..ef4325d2ea 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -3389,8 +3389,15 @@ void tst_QUrl::acceptEmptyAuthoritySegments() void tst_QUrl::effectiveTLDs_data() { + // See also: tst_QNetworkCookieJar::setCookiesFromUrl(). + // in tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp QTest::addColumn("domain"); QTest::addColumn("TLD"); + // TODO: autogenerate test-cases from: + // https://raw.githubusercontent.com/publicsuffix/list/master/tests/test_psl.txt + // checkPublicSuffix(domain, tail) appears in the list if + // either tail is null and domain is public or + // tail is the "registrable" part of domain; i.e. its minimal non-public tail. QTest::newRow("yes0") << QUrl::fromEncoded("http://test.co.uk") << ".co.uk"; QTest::newRow("yes1") << QUrl::fromEncoded("http://test.com") << ".com"; diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index 1ef2c118b9..0924b1e223 100644 --- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -166,6 +166,10 @@ void tst_QNetworkCookieJar::setCookiesFromUrl_data() // 2. anything .ck is an effective TLD ('*.ck'), but 'www.ck' is an exception result.clear(); preset.clear(); + cookie.setDomain(".ck"); + QTest::newRow("effective-tld.ck-denied") << preset << cookie << "http://foo.ck" << result << false; + result.clear(); + preset.clear(); cookie.setDomain(".foo.ck"); result += cookie; QTest::newRow("effective-tld2-accepted2") << preset << cookie << "http://foo.ck" << result << true; -- cgit v1.2.3