diff options
author | Michal Klocek <michal.klocek@qt.io> | 2022-06-01 17:19:19 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-09 08:06:22 +0000 |
commit | 5f74fc510c9707a5c930103e7dc5518c72e29345 (patch) | |
tree | f97ae7f9e22e158a7b8ecdb834828ec5c033918a | |
parent | d379ee8735df0bf44b2af40badd9cb6c53f27d71 (diff) |
Fix flakiness of jsServiceWorker test
This is an interesting issue as in the test sometimes first party
url of intercepted request has "sw.js" instead of "sw.html". After
deep debug of the issue the reason behind is that a service
worker registration job checks the registration for given scope
and the key, this in the turn will check storage in
ServiceWorkerStorage::FindRegistrationForScope. Now if registration
is found this will trigger service worker update checker,
which fires the request check for newer version for sw.js and makes
an intercepted request with sw.js as first party url. This of course
brakes the test.
Do not use the storage in that test, and let the service worker
registration job do full "install" & "register" cycle instead
of running "update" phase.
As a side note , using off the record profile makes test run faster
as opening the storage and closing it is costly.
Change-Id: If13a4fcf0014cc5c76cb8ed14e60f2e5e29c67ef
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 53f3775a532c8a926f3c7ba7d1daf8ada72be306)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp index 94669c4ca..d68910cf3 100644 --- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp +++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp @@ -727,7 +727,7 @@ void tst_QWebEngineUrlRequestInterceptor::jsServiceWorker() server.setResourceDirs({ QDir(QT_TESTCASE_SOURCEDIR).canonicalPath() + "/resources" }); QVERIFY(server.start()); - QWebEngineProfile profile(QStringLiteral("Test")); + QWebEngineProfile profile; std::unique_ptr<ConsolePage> page; page.reset(new ConsolePage(&profile)); TestRequestInterceptor interceptor(/* intercept */ false); |