fix: Enable WebEngineLoader qml tests

This commit is contained in:
Alex Jbanca 2024-10-04 18:12:07 +03:00 committed by Alex Jbanca
parent 0c0b2292bc
commit 92d8d601e5
4 changed files with 7 additions and 9 deletions

2
AppRun
View File

@ -9,7 +9,7 @@ export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${APPDIR}/usr/lib/nss:${LD_LIBRARY_PA
export QT_QPA_PLATFORM="xcb"
# TODO: Remove once qt 5.15.2 support is dropped
# Fixing bug: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1944468
export QTWEBENGINE_CHROMIUM_FLAGS="--disable-seccomp-filter-sandbox"
export QTWEBENGINE_CHROMIUM_FLAGS="${QTWEBENGINE_CHROMIUM_FLAGS} --disable-seccomp-filter-sandbox"
DEFAULT_LANG=en_US.UTF-8
if [[ "$LANG" == "C.UTF-8" ]]

View File

@ -330,6 +330,7 @@ statusq-tests:
--build $(STATUSQ_BUILD_PATH) \
$(HANDLE_OUTPUT)
run-statusq-tests: export QTWEBENGINE_CHROMIUM_FLAGS := "${QTWEBENGINE_CHROMIUM_FLAGS} --disable-seccomp-filter-sandbox"
run-statusq-tests: statusq-tests
echo -e "\033[92mRunning:\033[39m StatusQ Unit Tests"
ctest -V --test-dir $(STATUSQ_BUILD_PATH) ${ARGS}

View File

@ -40,7 +40,11 @@ int main(int argc, char *argv[])
QGuiApplication::setApplicationName(QStringLiteral("Status Desktop Storybook"));
qputenv("QT_QUICK_CONTROLS_HOVER_ENABLED", QByteArrayLiteral("1"));
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", QByteArrayLiteral("--disable-seccomp-filter-sandbox"));
auto chromiumFlags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS");
if(!chromiumFlags.contains("--disable-seccomp-filter-sandbox")) {
chromiumFlags +=" --disable-seccomp-filter-sandbox";
}
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumFlags);
QQmlApplicationEngine engine;

View File

@ -72,9 +72,6 @@ TestCase {
webEngineLoadedSpy.wait(1000)
verify(webEngine.instance !== null , "The WebEngineView should be available")
if (Qt.platform.os === "linux") {
skip("fails to load page on linux")
}
pageLoadedSpy.wait(1000)
webEngine.active = false
engineUnloadedSpy.wait(1000);
@ -85,10 +82,6 @@ TestCase {
SignalSpy { id: wcInitOkSpy; target: testObject; signalName: "webChannelInitOk" }
SignalSpy { id: wcInitErrorSpy; target: testObject; signalName: "webChannelError" }
function test_executeCode() {
if (Qt.platform.os === "linux") {
skip("fails to load page on linux")
}
const webEngine = loader.item
webEngine.active = true
pageLoadedSpy.wait(1000);