summaryrefslogtreecommitdiffstats
path: root/tests/auto/core/qwebengineurlrequestinterceptor
Commit message (Collapse)AuthorAgeFilesLines
* Nuke all qmake files from testsMichal Klocek2021-09-012-26/+0
| | | | | | | Change-Id: Ibad2e50d840a2eb0ccb9ac65158e512249a2bc79 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 24a695b4b7fda581c15600b111d6b6c3459ca1d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Stop using Widgets in WebEngineCore testsAllan Sandfeld Jensen2021-06-161-1/+1
| | | | | | | | | | | With QWebEnginePage in Core we can now make the core tests core-only. Add the same times moves tests from widgets that only uses core classes. Change-Id: I67a25b534912d9a0891e16b0419f0db9bf434e92 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit b8c48ee53009365a39d9dde1f6773048ec5ee4a0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix some compiler warningsPeter Varga2021-06-101-1/+1
| | | | | | | | | | | | | | - Remove deprecated Qt::AA_EnableHighDpiScaling and Qt::AA_UseHighDpiPixmaps from examples. High-DPI scaling is always enabled. - Reorder initialization of members of QWebEngineDownloadRequestPrivate. Also remove m_ prefix from public members' name. - Remove unused parameters from methods of DummyDelegate. - Add missing overrides in auto tests. Change-Id: I18d6973b8bee574b37b73fbaaa8d57002ac8ba2d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 740b8c94f27930a33298c81c2284d1f0a9e2f11b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace calls to obsolete cmake functions with modern alternativeFabian Kosmale2021-06-071-1/+1
| | | | | Change-Id: I5674d887a73a6a693d1babc416470c9873491eb3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add tests to the cmake buildMichal Klocek2021-05-222-19/+84
| | | | | | | | | | | | | | | | | | | | Use QT_TESTCASE_SOURCEDIR instead of TESTS_SOURCE_DIR. Introduce Test::HttpServer and Test::Util targets. Query shared data location from server. Clean up "shared" resources. Note QT_TESTCASE_SOURCEDIR must be turned into the canonical form since the user can call on windows: "cmake \path\to\foo" instead of "cmake c:\path\to\foo" which will break all file:// urls. Note this patch breaks qmake builds. Task-number: QTBUG-91760 Change-Id: Ibc1f904ac9acd375d1ff70ff80f0c533497e3f20 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Allan Sandfeld Jensen2021-05-131-1/+1
|\
| * Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-05-121-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webenginewidgets/printme/printhandler.cpp src/3rdparty src/core/api/qwebenginepage_p.h src/core/content_browser_client_qt.h src/core/web_contents_adapter_client.h src/core/web_contents_delegate_qt.cpp src/core/web_contents_delegate_qt.h src/webenginequick/api/qquickwebengineview_p_p.h tests/auto/quick/qmltests/data/tst_download.qml tests/auto/quick/qmltests/data/tst_viewSoure.qml tests/auto/widgets/loadsignals/tst_loadsignals.cpp tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp Change-Id: I9c1819ec15e13d4f8e244defe860e26274b5d4be
| | * Fix first party url for cookie filterTamas Zakor2021-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop using SiteForCookies::RepresentativeUrl() if it is used to provide first party url because it returns a truncated URL and our API is expected to return the full url of the first party. Fixes: QTBUG-90231 Change-Id: I628f7f31bfbeaf3de976ae9af1a8fa6408b661c5 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* | | Remove ResourceTypeSubFrame check after website updateKirill Burtsev2021-05-111-12/+0
|/ / | | | | | | | | | | | | | | | | There are no more sub frame resources under test url, so nothing to check for firstPartyUrl and initiator. Pick-to: 5.15 Change-Id: I12ddf33ec2909d9a427a9819725d941960575612 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-02-171-0/+127
|\| | | | | | | Change-Id: Idee0142b0e33fdf8ca663f1ef1bcd8b932985043
| * Resolve installed interceptors right before interception pointKirill Burtsev2021-02-081-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | Ammends a05bb73747. Since request processing is asynchronous, resolve interceptors right before actual interception point to accommodate cases where interceptor on profile or page was replaced or uninstalled before all instantiated InterceptedRequest's are processed. Effectively, this doesn't send url requests to uninstalled interceptors. Fixes: QTBUG-86286 Change-Id: Iaf55e5ef99d62b55f7304ee68a0c89a1469fd86f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-12-113-29/+66
|\| | | | | | | Change-Id: Id1a1f4ca84697ba18e2604090e3154295fe1858b
| * Set custom headers from QWebEngineUrlRequestInfo before triggering redirectKirill Burtsev2020-12-013-31/+67
| | | | | | | | | | | | Fixes: QTBUG-88861 Change-Id: I7091aca70aaf87edf0b1e67ec3fa705a59c8192c Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Move QWebEnginePage to coreMichal Klocek2020-11-241-1/+1
| | | | | | | | | | | | | | | | | | [ChangeLog] QWebEnginePage is in QtWebEngineCore Task-number: QTBUG-74585 Change-Id: Id326c89c868e9e7d53488bbd12cb321e1a0b79b7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Remove deprecated url interoceptor setter from profileMichal Klocek2020-11-201-105/+34
| | | | | | | | | | | | Change-Id: I15c621da6da97b2ccdd57afdfad0d413302d3c24 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Move profile from widgets to coreMichal Klocek2020-11-201-1/+1
| | | | | | | | | | | | | | | | This just moves class to core. Task-nmuber: QTBUG-74585 Change-Id: Id046eee21043f086f5f45727bc3ce7c965695b7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-09-141-46/+30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/certificate_error_controller.cpp src/core/certificate_error_controller.h src/core/compositor/compositor.cpp src/core/compositor/compositor.h src/core/compositor/display_gl_output_surface.cpp src/core/content_browser_client_qt.cpp src/core/core_chromium.pri src/core/delegated_frame_host_client_qt.cpp src/core/ozone/gl_share_context_qt.h src/core/ozone/surface_factory_qt.cpp src/core/permission_manager_qt.cpp src/core/render_widget_host_view_qt.cpp src/core/render_widget_host_view_qt.h src/core/web_engine_context.cpp src/core/web_engine_settings.cpp src/core/web_event_factory.cpp tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp Change-Id: Ice14c3c350b139e800c7c7011b7cef1fc7010669
| * Chromium 81-based adaptationsAllan Sandfeld Jensen2020-09-091-1/+1
| | | | | | | | | | Change-Id: Ie422b327025da084bc8038c7a0aadee2db801f29 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| * Merge remote-tracking branch 'origin/5.15.1' into 5.15Allan Sandfeld Jensen2020-09-071-10/+27
| |\ | | | | | | | | | Change-Id: Ieb546ccd35db06e8ad6358b11e3139a839c9b4cf
| | * Do not call deprecated profile interceptor on ui threadKirill Burtsev2020-09-011-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise unchanged intercepted request leads to second call in the same interceptor but on ui thread after io thread. Ammends a05bb73747. Fixes: QTBUG-86267 Change-Id: I4e7c662d24a58be5445f5c8b6d0bf3751f40cc05 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Make HttpServer to server resource from dirs for unhandled requestsKirill Burtsev2020-08-311-32/+2
| | | | | | | | | | | | | | | Change-Id: I2e15dff77c8f18af60a565cb74558f57c3527db8 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| * | Simplify testing with HttpServerKirill Burtsev2020-08-311-5/+2
| |/ | | | | | | | | | | | | | | Since reply with 404 for unknown resources is a common pattern in tests, reply with it automatically for unhandled requests Change-Id: Ifd184cf474f1ec311c8654dfbacdd735e33d7c97 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Move qwebenginesettings to coreMichal Klocek2020-09-021-1/+1
| | | | | | | | | | | | | | | | | | Just moves qwebenginesettings to core. [ChangeLog] QWebEngineSettings is moved to QtWebEngieCore Change-Id: I7f623bce98213669a4b844f3377aa13e7f3dbd96 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Use QList instead of QVectorJarek Kobus2020-07-151-2/+2
|/ | | | | | Task-number: QTBUG-84469 Change-Id: I666a060351f73783e15e3f96884c9393a5cd7e46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add test for first party urls of service workerTamas Zakor2020-05-264-0/+109
| | | | | Change-Id: Ic26d982ef9695705a9f7c757b7d983824b31a070 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move request interceptor to ui threadMichal Klocek2020-04-201-27/+96
| | | | | | | | | | | | | We use now network service avoid io-ui-io-ui hops, pipe proxying url loader factory directly to ui thread. This solves thread safty issues. Add deprecated request interceptor test cases. Task-number: QTBUG-83082 Task-number: QTBUG-82999 Change-Id: I38778cf1a70789c5e92e04c93d1c93e2cc4c765a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-02-191-10/+10
|\ | | | | | | | | | | | | | | | | Blacklisted one test requiring an update of qt5.git. Conflicts: .qmake.conf Change-Id: I75e55a1c5f8840cde55ddb60d632287b2affadeb
| * Fix tst_QWebEngineUrlRequestInterceptor::initiator flakinessJüri Valdmann2020-02-181-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | The test assumes a 1-1 correspondence between request URLs and initiator origins, but really we have a 1-N correspondence since the same URL can be requested multiple times by different initiator origins. The current flakiness results from just such a conflict, namely from one URL being requested both by the main site (w3schools.com) and by AdSense (doubleclick.net). Fixes: QTBUG-82288 Change-Id: Ida121d8f23b396b72a28faab91780d6fa4d99c92 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* | Experimental network-service supportAllan Sandfeld Jensen2019-12-051-0/+8
|/ | | | | | | | | | | | | | | | | | | | | | Is default off, enable with --enable-network-service. Done: * Basic browsing * Basic profile settings * Custom URL schemes * UI-thread interceptors * CookieStore API * CookieStore filters * CookieStore changed events Missing: * deprecated interceptors * complete profile settings * cleanup of system network-context * proxy settings Change-Id: I6af92da40147b968a938d1263df54c4cfe7bcf6d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Add QWebEngineUrlRequestInfo::initiator()Tamas Zakor2019-06-051-0/+69
| | | | | | | | | | Returns the origin url of the document which initiated the navigation when a frame navigates another frame. Task-number: QTBUG-75759 Change-Id: Ia2884b5a3027cceea45f0e659652b02036faaacb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Allan Sandfeld Jensen2019-05-242-0/+44
|\ | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/net/network_delegate_qt.cpp tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp Change-Id: Ib715b3047213583e0441b915d3cabb801d9d4ba8
| * Referrer HTTP Header no longer ignored when set via RequestInterceptorLeander Beernaert2019-05-202-0/+44
| | | | | | | | | | | | | | | | | | | | | | Make sure the HTTP referer is properly placed on a request when it's set via the QWebEngineUrlRequestInterceptor. Added test case to catch future incidents. Fixes: QTBUG-60203 Change-Id: Ida2f713a7352c3199fc9f8e15b5d8350d50afdda Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Move QWebEngineUrlRequestInterceptor::intercept to ui threadMichal Klocek2019-02-041-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently interceptor sufferers thread safety issues, when custom profiles are deleted, interceptor is set to be nullptr, however it can be still referenced in IO thread. Since profile was split to ui and io part, where io part can outlive the ui part, this can boost thread safety issues. Since QWebEngineUrlRequestInterceptor is living on ui thread simplify the logic move intercept call to ui thread. This fixes the issue of referencing interceptor in io thread. Add new method to install interceptor setUrlRequestInterceptor, and deprecate old one. Update interceptor install method name on page to match the profile one. Task-number: QTBUG-69844 Change-Id: I5dd2b6b734fd91906cccc6c1408ffbe7b1b4250c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 71Allan Sandfeld Jensen2019-01-281-4/+1
| | | | | | | | | | | | | | Change-Id: Ib650113b05dfd4771240804f94e33c07aa317bf2 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devMichael Brüning2019-01-1817-18/+321
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/core/net/network_delegate_qt.cpp src/core/profile_io_data_qt.cpp src/core/web_engine_context.h tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp Change-Id: Id98e3f52f548ceb5b68abd80aedd6ae59db72cc0
| * Fix QWebEngineUrlRequestInfo::firstPartyUrl() after 69-basedTamas Zakor2019-01-0317-18/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was introduced by this Chromium change: https://chromium-review.googlesource.com/c/chromium/src/+/1025772/ Add new auto tests for first party url. Depends on Chromium change: d2f5d6869f Add net::URLRequest::first_party_url() Task-number: QTBUG-70790 Change-Id: Ib43bde69990e7fb1d495cc32ac2f6860a613f185 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add setRequestInterceptor to QWebEnginePageAllan Sandfeld Jensen2018-10-171-3/+28
|/ | | | | | | | | | | | Makes it possible to make page specific intercepts, and is at the same time safer by running in the UI-thread. [ChangeLog][QtWebEngineWidgets][QWebEnginePage] Added setRequestInterceptor, similar to the same call on profile except it operates on a per-page basis and on the UI-thread. Change-Id: Id5a7173156c25d0f030f00b6ef314d283c7c8cdd Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Test adaptations for Chromium 63Allan Sandfeld Jensen2018-01-251-0/+6
| | | | | Change-Id: I19bf693fb3916a78f4a199e6e095ca58b8fdfa27 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Cleanup core API testsAllan Sandfeld Jensen2018-01-081-25/+29
| | | | | | | | Use in-memory profile and do not use qwebengineviews when all we need are qwebenginepages. Change-Id: I5798c761bccfc0b4bf2cf623e7db35f033bdfd84 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Auto test adaptations for Chromium 58Allan Sandfeld Jensen2017-06-141-5/+4
| | | | | | | | Adjustments to auto tests to pass with Chromium 58 Change-Id: I7f6905e5344c528c608734bc660cbf43c89d4a63 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port autotests from own waitForSignal() to QSignalSpy::wait()David Faure2016-11-291-8/+8
| | | | | | | | I added QSignalSpy::wait() in Qt 5.0 exactly for this purpose. Change-Id: I895a92f5f7e4e8554e00f6668e6973cc2c903adf Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add FaviconManager to corePeter Varga2016-02-031-0/+3
| | | | | | | | | The new icon manager uses the WebContents::DownloadImage() API for downloading icons. It proposes the best quality among the available favicons via the iconChanged signal. Change-Id: I66a014365b6f6560ff34d40ee870aee84e4e70e4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Updated license headersJani Heikkinen2016-02-011-23/+10
| | | | | | | | | | | | From Qt 5.7 -> tools & tests are licensed under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header (in those files which will be under GPL 3 with exceptions) Change-Id: I59fcbb8cd1ca42b1a5ef96577bcb35ea0af01b71 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Change QWebEngineUrlRequestInterceptor::interceptRequest to void.Michael Bruning2015-12-021-5/+3
| | | | | | | | Now uses a flag in QWebEngineUrlRequestInfoPrivate to store if the interceptor actually changed the request. Change-Id: Idccbd1c15696e577ee69248e53b75ba6ec1c571c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* enable tests/auto/coreJoerg Bornemann2015-10-301-1/+0
| | | | | | | | Enable autotests and blacklist tests that are known to fail. Add skips and waits and mark them with the corresponding task numbers. Change-Id: I993e366ba3b07239a8ba15eae2ee8e3e2aaa8308 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Add firstPartyUrl to QWebEngineUrlRequestInfoDavid Rosca2015-10-123-0/+26
| | | | | | | | Add firstPartyUrl that can be used to identify third-party requests. Change-Id: I2b8e48ff0a1a4402af224c80f91d4e599a61a89c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Change some QNAM tests to use URLRequestInterceptorSzabolcs David2015-09-141-1/+103
| | | | | Change-Id: I83536664df15375622e1b24496685ae19ab829c1 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Fix build of tst_qwebengineurlrequestinterceptorSzabolcs David2015-09-071-4/+4
| | | | | | | Fixes a regression of 6ef0a365124d435314113837dc77fa07b02ff86b Change-Id: Ibf54d4c3d0d5b9aad88be8720da38d3142f7a559 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* move automatic resource inclusion to pri filesJoerg Bornemann2015-08-251-1/+0
| | | | | | | Avoid code duplication. Change-Id: Icd270ff4e45112111b7eb9590e415947f63ce15b Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Add API for intercepting url requestsAndras Becsi2015-08-035-0/+184
This patch is adding a QWebEngineUrlRequestInterceptor interface that can be subclassed to observe or intercept all resource requests making it possible to implement browser features like adblocking and setting custom request headers for url requests. The interceptRequest virtual function is executed on the IO thread. This patch also includes a unit test for the testable API parts. Change-Id: Ibe740fc55551a9a5da40794088ccb6d03d913631 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Martin Rotter <rotter.martinos@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>