Commit b26f697d authored by Szabolcs David's avatar Szabolcs David
Browse files

Fix tst_qwebengineaccessibility API test


Implement a custom QTEST_MAIN preprocessor macro in order to
support hardcoded Chromium content switches in the API tests.

Force renderer accessibility to be on instead of enabling it on
demand when a screen reader is detected.

Change-Id: I9600ac4b26f4656104ce27ff19accbed4ea817c6
Reviewed-by: default avatarPierre Rossi <pierre.rossi@theqtcompany.com>
Showing with 21 additions and 1 deletion
......@@ -245,5 +245,8 @@ void tst_QWebEngineView::value()
QCOMPARE(progressBarValueInterface->maximumValue().toInt(), 99);
}
QTEST_MAIN(tst_QWebEngineView)
static QByteArrayList params = QByteArrayList()
<< "--force-renderer-accessibility";
W_QTEST_MAIN(tst_QWebEngineView, params)
#include "tst_qwebengineaccessibility.moc"
......@@ -164,3 +164,20 @@ static inline QUrl baseUrlSync(QWebEnginePage *page)
}
#define W_QSKIP(a, b) QSKIP(a)
#define W_QTEST_MAIN(TestObject, params) \
int main(int argc, char *argv[]) \
{ \
QVector<const char *> w_argv(argc); \
for (int i = 0; i < argc; ++i) \
w_argv[i] = argv[i]; \
for (int i = 0; i < params.size(); ++i) \
w_argv.append(params[i].data()); \
int w_argc = w_argv.size(); \
\
QApplication app(w_argc, const_cast<char **>(w_argv.data())); \
app.setAttribute(Qt::AA_Use96Dpi, true); \
QTEST_DISABLE_KEYPAD_NAVIGATION \
TestObject tc; \
return QTest::qExec(&tc, argc, argv); \
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment