diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/widgets/proxypac/CMakeLists.txt | 22 | ||||
-rw-r--r-- | tests/auto/widgets/proxypac/proxy.pac | 2 | ||||
-rw-r--r-- | tests/auto/widgets/proxypac/tst_proxypac.cpp | 14 |
3 files changed, 30 insertions, 8 deletions
diff --git a/tests/auto/widgets/proxypac/CMakeLists.txt b/tests/auto/widgets/proxypac/CMakeLists.txt index 0397a4f66..a261f26bc 100644 --- a/tests/auto/widgets/proxypac/CMakeLists.txt +++ b/tests/auto/widgets/proxypac/CMakeLists.txt @@ -24,6 +24,22 @@ set_tests_properties(tst_proxypac_file PROPERTIES ENVIRONMENT QTWEBENGINE_CHROMIUM_FLAGS=${fileEnvArg} ) +if(NOT (LINUX AND CMAKE_CROSSCOMPILING)) + set(fileEnvArg "--single-process ${fileEnvArg}") + + qt_internal_add_test(tst_proxypac_single_process + SOURCES + tst_proxypac.cpp + LIBRARIES + Qt::WebEngineCore + Test::HttpServer + ) + + set_tests_properties(tst_proxypac_single_process PROPERTIES + ENVIRONMENT QTWEBENGINE_CHROMIUM_FLAGS=${fileEnvArg} + ) +endif() + qt_internal_add_test(tst_proxypac_qrc SOURCES tst_proxypac.cpp @@ -43,8 +59,6 @@ set_tests_properties(tst_proxypac_qrc PROPERTIES ) qt_internal_add_resource(tst_proxypac_qrc "proxypac" - PREFIX - "/" - FILES - "proxy.pac" + PREFIX "/" + FILES "proxy.pac" ) diff --git a/tests/auto/widgets/proxypac/proxy.pac b/tests/auto/widgets/proxypac/proxy.pac index 1d29847b9..966c37ba5 100644 --- a/tests/auto/widgets/proxypac/proxy.pac +++ b/tests/auto/widgets/proxypac/proxy.pac @@ -2,6 +2,6 @@ function FindProxyForURL(url, host) { if (shExpMatch(host, "*.proxy1.com")) return "PROXY localhost:5551"; if (shExpMatch(host, "*.proxy2.com")) return "PROXY localhost:5552"; - return "PROXY proxy.url:8080"; + return "DIRECT"; } diff --git a/tests/auto/widgets/proxypac/tst_proxypac.cpp b/tests/auto/widgets/proxypac/tst_proxypac.cpp index 8667af24a..d372f77fa 100644 --- a/tests/auto/widgets/proxypac/tst_proxypac.cpp +++ b/tests/auto/widgets/proxypac/tst_proxypac.cpp @@ -8,7 +8,6 @@ #include <QWebEnginePage> #include <QNetworkProxy> - class tst_ProxyPac : public QObject { Q_OBJECT public: @@ -39,11 +38,20 @@ void tst_ProxyPac::proxypac() QWebEngineProfile profile; QWebEnginePage page(&profile); + + const bool v8_proxy_resolver_enabled = !fromEnv.contains("--single-process"); page.load(QUrl("http://test.proxy1.com")); - QTRY_COMPARE(proxySpy1.count() >= 1, true); + QTRY_COMPARE(proxySpy1.count() >= 1, v8_proxy_resolver_enabled); QVERIFY(proxySpy2.count() == 0); page.load(QUrl("http://test.proxy2.com")); - QTRY_COMPARE(proxySpy2.count() >= 1 , true); + QTRY_COMPARE(proxySpy2.count() >= 1, v8_proxy_resolver_enabled); + + // check for crash + QSignalSpy spyFinished(&page, &QWebEnginePage::loadFinished); + page.load(QUrl("https://contribute.qt-project.org")); + + QTRY_VERIFY_WITH_TIMEOUT(!spyFinished.isEmpty(), 100000); + } #include "tst_proxypac.moc" |