summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebenginesettings
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-08-24 16:37:06 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-09-18 21:57:53 +0000
commit491ab25ac8ce735f1d44a6eed08f9e1b8fecdc96 (patch)
treee59632ed6127bc648ecb89695b14828723a7ec51 /tests/auto/widgets/qwebenginesettings
parente44c981380db5e723a08acb2520ea1e3e2a89b54 (diff)
Add widget auto test for WebEngineSettings default font families
Task-number: QTBUG-55222 Change-Id: Iff7ffc81d83598eff5ab8b1386298241e8a10979 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/widgets/qwebenginesettings')
-rw-r--r--tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp b/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp
index 0f6a6062..d8c18e50 100644
--- a/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp
+++ b/tests/auto/widgets/qwebenginesettings/tst_qwebenginesettings.cpp
@@ -27,6 +27,8 @@ class tst_QWebEngineSettings: public QObject {
private Q_SLOTS:
void resetAttributes();
+ void defaultFontFamily_data();
+ void defaultFontFamily();
};
void tst_QWebEngineSettings::resetAttributes()
@@ -58,6 +60,27 @@ void tst_QWebEngineSettings::resetAttributes()
QCOMPARE(defaultSize, settings->fontSize(QWebEngineSettings::MinimumFontSize));
}
+void tst_QWebEngineSettings::defaultFontFamily_data()
+{
+ QTest::addColumn<int>("fontFamily");
+
+ QTest::newRow("StandardFont") << static_cast<int>(QWebEngineSettings::StandardFont);
+ QTest::newRow("FixedFont") << static_cast<int>(QWebEngineSettings::FixedFont);
+ QTest::newRow("SerifFont") << static_cast<int>(QWebEngineSettings::SerifFont);
+ QTest::newRow("SansSerifFont") << static_cast<int>(QWebEngineSettings::SansSerifFont);
+ QTest::newRow("CursiveFont") << static_cast<int>(QWebEngineSettings::CursiveFont);
+ QTest::newRow("FantasyFont") << static_cast<int>(QWebEngineSettings::FantasyFont);
+}
+
+void tst_QWebEngineSettings::defaultFontFamily()
+{
+ QWebEngineProfile profile;
+ QWebEngineSettings *settings = profile.settings();
+
+ QFETCH(int, fontFamily);
+ QVERIFY(!settings->fontFamily(static_cast<QWebEngineSettings::FontFamily>(fontFamily)).isEmpty());
+}
+
QTEST_MAIN(tst_QWebEngineSettings)
#include "tst_qwebenginesettings.moc"