summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Handle empty uri-list in dropped MIME data6.6Moss Heim2024-04-051-0/+23
| | | | | | | | | | | | | Previously WebContentsAdapter assumed that drag-n-drop MIME data with hasUrls() == true would also have a nonempty url list. This is not always the case. Instead, check directly if urls() is nonempty. Fixes: QTBUG-123765 Change-Id: I9e2189e3f0223f98bdd8be273adb96cf063f4be3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit fa8ff1bb933b02f61e406cb29d5c8d4294676a5a) Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Convert "page" <-> "view" coordinates for PdfSelection and LinkModelShawn Rutledge2024-03-255-1/+293
| | | | | | | | | | | | | | | | | | | Use FPDF_PageToDevice() rather than subtracting from page height, in all the remaining places where we were doing that. Also use FPDF_DeviceToPage() to convert coordinates coming from the view, for hit-testing links and for selecting ranges of text. Mark the private utility functions that we're modifying const while we're at it. Pick-to: 6.5 Task-number: QTBUG-100630 Fixes: QTBUG-106565 Change-Id: Ide4f73b80888a0e08381c6e4995f69ebeaa2d12f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit b78c78349d786b294ee0845717ad5db38ae2565a) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 5642f33e17aa82fd361b972cd8ac88ba83604273) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix flaky horizontalScrollbarTestMartin Negyokru2024-03-121-0/+94
| | | | | | | | | | | | Mouse events will miss the hittesting if they are sent before the page is drawn. Introduce new test page that listens for first paint events. Change-Id: I4846ec1bde3805f5dd0098d490cb85c72cb0884f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 290d7462696664a1e035082793907d3c698bc987) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2b7954461c2d9d2e981768b255bec1caaabf18d0)
* Delay PdfMultiPageView.goTo[Page|Location] if called too earlyShawn Rutledge2024-01-282-0/+30
| | | | | | | | | | | | | | | | | | | | PdfMultiPageView does not expose a property alias to TableView.rows; we could call it pageCount, but we don't want to mislead users into thinking that the view is the "source of truth" for how many pages it's going to show. The document's pageCount is populated earlier, and that's a problem only in such a case when it's too early to ask the view to go to a particular page. So we work around it in the view by treating these goTo functions as requests to be satisfied as soon as it becomes possible. Fixes: QTBUG-119416 Pick-to: 6.5 Change-Id: Ie2377fe6f2983b72e871b1be2afe4d0878f60841 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit e9a5b6e514996c059d52a857a5aef624afb80a0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d63c4dacd2b4ffa2608965ed7e49303b75c722ad) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix discontinuity with successive pinch-zoom in PdfMultiPageViewShawn Rutledge2024-01-271-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | pinch.persistentScale is settable since 6.5 (qtdeclarative a432970b258edb9ff041d221b2155df30cad4799): we need that to tell PinchHandler to start over from 1 after we have also set the rendered scale back to 1, because PinchHandler does not read the scale property for itself. This cherry-pick includes 48ebac59b1ec5bbafa1c64adbdbc44b0cf3f302a to avoid a crash on exit by waiting for the rendering to be done, and a4e64baef027fb407b8c1491c444ed58edd15529 to disable touch compression. Fixes: QTBUG-115502 Task-number: QTBUG-120245 Task-number: QTBUG-121502 Fixes: QTBUG-121564 Pick-to: 6.5 Change-Id: I21951c447bf33e5942b6a1635488d5474ec8f293 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c0524da14d92a957b4607fb5867dba5d23eea6d9) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 8c27ae33f80440d20f578fa404c454c8d7bfdf19) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correct PrintedPageSizeId to match QPageSize::PageSizeIdMichael Brüning2024-01-241-4/+2
| | | | | | | | | | | | | With Qt 6, QPageSize::PageSizeId enum was cleaned up and some values were reordered, but the WebEngineQuick part was not changed accordingly. Pick-to: 6.5 Fixes: QTBUG-120218 Change-Id: I7e4c419750d30a64193e68b0b217ebbccce07d87 Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 199730bd41219c5484fb1c4c61b637ab9ceec0c4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 8f017c2d9d015b9d72a7f1f36e53747bad6c3bfa)
* Fix cursor position during compositionAnu Aliyas2024-01-212-10/+59
| | | | | | | | | | | | | | | | During input composition, the cursor is set to the starting position of the string being edited and refrain from updating it throughout the composition process. Once the string is committed, it is set to the last position of the committed string. The modified code is designed to exhibit the same behavior as the widget and quickwidget. Fixes: QTBUG-118746 Pick-to: 6.5 Change-Id: I9adb7a9bea9493457a1d9d4b32338cdba30920a1 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit c9550388b9ab1d82454d0c59eaaf7e640d83d750) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 266c9a5605e05166c0b6e9113e19595856149bd2)
* Fix printing from PDF pluginSzabolcs David2024-01-121-0/+46
| | | | | | | | | | | | | | | | Update the plugin finder logic everywhere to match with Chrome. This comes with a small cleanup: collect PDF-related helper functions scattered around WebEngine in one pdf_util_qt implementation. Add auto test to catch this recurring issue earlier. Task-number: QTBUG-119878 Change-Id: I03b2bd62bebf5b38afc572e0629db106d024e89d Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit e09cf6e7a1f582d06f86ff2c166b7c2269fd4b47) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit a1ffdacd23c13d97793b87f098e3ec7ab8ff1de6) Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* QQuickPdfPageImage::load(): fall back to base class impl to avoid crashShawn Rutledge2024-01-075-0/+495
| | | | | | | | | | | | | | | | | | | | | | | | | Plain Image is ok for loading one PDF page at a time, except that the pdf plugin has to create its own PDF document object if it cannot reuse an instance that is already open. So PdfPageImage was created just as an optimization, with the expectation that the document will be given to the document property. But in case someone doesn't understand and tries to set only the inherited Image.source property instead, fall back to QQuickImageBase::load() to avoid crashing. Amends 7b8832ca2b84d549c9d374550c3c46b3d4d42a38 If both the document and source properties are set, prefer the document (for the sake of performance). Add test coverage of other combinations of properties, while we're at it. Pick-to: 6.5 Fixes: QTBUG-104767 Task-number: QTBUG-77506 Change-Id: I1ee0d0bb2a6c5f399234ddddd969be02e7a6c020 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit b60c00f4adec9ea4b75af0226b04a7125e166ae2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 2180ce8901ac1caddf5b7b5cd73ba67d2d08349a)
* Add missing cmake includeMichal Klocek2024-01-071-0/+1
| | | | | | | | | | | | | | | | Without the include module build with BUILD_TESTS=ON is broken as cmake function call for dictionary setup is not found. This commit amends 73d58b489e8f4f900042f0ab6c1104e6431752e1. Pick-to: 6.5 Change-Id: I2c02317b92e1b5726963d120bf97dff1a12c7375 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit b50731bffae31729b1c5c43ad7f869b5cc65e81b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 3b038efa3762a8e7603529c7882d99b1d92fe6e8)
* Fix typo in test_window_openAllan Sandfeld Jensen2023-12-091-1/+1
| | | | | | | | | Apparently didnt affect test results though Change-Id: I86809e6287ba7ca80209146c73a0cc0d523756ac Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit d443984a4e575dc176783886a732409f32a3b790) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compilation arm64Michal Klocek2023-11-301-1/+4
| | | | | | | | | | Add missing header include. Do not compile global setting tests as it tests so far only doh and requires ssl. Fixes: QTBUG-119525 Change-Id: I011cd3b0ed6e9d5e55e1fc80a102cc7a388681f1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* tst_QQuickWebEngineViewGraphics crash in Debug modeAnu Aliyas2023-11-241-0/+1
| | | | | | | | | | | - DCHECK hit while running tst_QQuickWebEngineViewGraphics test. - Added qWaitForWindowExposed() to wait for the windows, and then perform the verification. Change-Id: Ia5c2dba5f1c38ae06e7aac24f0f6d5f3d6f5859d Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit f3322daf3782edf7204c1ee7fd6dbeacfa369430) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Provide the correct type information for WebEngineViewAnu Aliyas2023-11-111-6/+6
| | | | | | | | | | | | | -Duplicate entries in the QML type file are created when exporting the type as a value and its enums within a namespace. Resolved this by introducing a derived class, and using it for exporting the Enums. - Added namespace resolution to avoid type ambiguity Fixes: QTBUG-117031 Change-Id: Ieea4492238843c3c781c8d9602ddc89207b61137 Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit e96b6d58801f541f5e67330cf2dc6f9aa52522a5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix accessibility crash on elements with cell rolePeter Varga2023-11-111-0/+53
| | | | | | | | | | | | Not only tables can have cell as a child. Pick-to: 6.5 Fixes: QTBUG-119023 Task-number: QTBUG-113859 Change-Id: Ic997f752059f5ac3cac9a7d7cf1fefcecbc2ddd5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit ea0682573613c1bad9d65b3e7d61f58708026c31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Let page interceptor process requests with extra headersSzabolcs David2023-11-101-1/+60
| | | | | | | | | | | | | | | If a QWebEngineUrlRequestInterceptor has added extra headers to the request on profile level, later the request was not processed by the page interceptor. Relax this rule and only prevent the interception of blocked or redirected requests. Add auto test and extend documentation. Task-number: QTBUG-117752 Change-Id: I503bfc256a5e874a678be64c597c74e04e7ce966 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit eda7378655fa047007dcdb47aec3641b2a89d0de) Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Allow cancelling automatically accepted download requestsSzabolcs David2023-11-071-3/+22
| | | | | | | | | | | | | | Calling QWebEngineDownloadRequest::cancel() had no effect if the download request was accepted by default. These downloads had no corresponding internal DownloadItem yet, but we tried to cancel them using the DownloadManager. The safest option is to always check if the DownloadItem exists in Chromium. Task-number: QTBUG-117624 Change-Id: I8f92d45e00e088aea7d22d5b7271b5b09adf6cbb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 02675c653eb1b03ba84409e20a15f4a502b88bab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Reinstall URLRequestInterceptors during new view adoptationSzabolcs David2023-11-021-0/+49
| | | | | | | | | | | | The pointer to the page interceptor is stored in WebContentsAdapter and we lose it when recreating the adapter. Prevent this and add auto test. Fixes: QTBUG-117867 Change-Id: I5e79cdcc5996bdf2bb53c3016d4133f978ccfb39 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit d2f119a94d27a98fd58a0c60bacfc8f91e028a34) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip comboBoxPopupPosition* tests on apple m1Michal Klocek2023-10-281-6/+15
| | | | | | | | | | | | | We have constant crashes on apple m1 with those test, skip it for now. Verify window in comboBoxPopupPosition* tests. Change-Id: I4b9744fbcae556bc8d17e7602d003f306f54c62d Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 889b236e4e2d6ec54d6750e970ef673c487bc18a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Support auto accepting non-HTML saves when a path was specifiedSzabolcs David2023-10-051-0/+20
| | | | | | | | | | | | | | | | Images and PDFs had to be explicitly accepted to download, even if a filePath was given as argument of QWebEnginePage::save(). This behavior was inconsistent with saving HTML pages (and the documentation). Adjust the corresponding test case with verifying the download result of an auto-accepted download, and add a new test case to make sure about downloads are not accepted by default when there is no desired filePath. Task-number: QTBUG-117624 Change-Id: I90f4cfa485da2831327bcb25571a0b69499d9006 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 7406d087d4fb9bed86d3a79c1539edab7a0f8842) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Support filePath argument of save() when saving non-HTML filesSzabolcs David2023-10-031-0/+2
| | | | | | | | | | | | | | | Currently the filePath argument of QWebEnginePage::save() is ignored when the user tries to download anything but HTML; and the requested download path is the Downloads folder of the OS. Fix this and adjust the corresponding test case with checking path and file name of the download request. Task-number: QTBUG-117624 Change-Id: Ia1d3afc898b1aad223aab772b775724a50e88bd3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit b8ee80acdadefff927ed2c2884e0e67c9c2fc9a9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do more WE processing before returning to the Qt event-loopAllan Sandfeld Jensen2023-09-303-13/+14
| | | | | | | | | | Fix a race-condition in our tests that the change exposed Task-number: QTBUG-116478 Change-Id: Id21c6b0bc9934fdcb69bd85350f5f263a9b96914 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 3cbb895954e0d22efc20700a1e66413a8a483124) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve QWebEngineDownloadRequest::isSavePageDownload()Szabolcs David2023-09-301-0/+21
| | | | | | | | | | | | | | | | | | | | WebContentsImpl::IsSavable() decides which file formats are saveable, but it allows this only for text-based files. All other files will go around on the code path of downloading. MHTML (multipart) and PDF files are saved like this, which means they aren't marked as isSavePageDownload. Just simply set this flag if the save was requested by the user even if it was a download. This fixes the flag for saving MHTML and PDF files from context menu, and leaves the flag false when a PDF download was initiated by the button of the web UI. Task-number: QTBUG-114859 Change-Id: Id65f26a96952c5a43876338ad37f40570e544f3a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit ba20f9e892746639ebf888ef2e86add8839c3631) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle initial NavigationEntriesMartin Negyokru2023-09-292-8/+8
| | | | | | | | | | | | | | | | | | | Chromium introduced the Initial NavigationEntry that meant to represent the initial empty document at FrameTree creation time. It is just a placeholder entry put in the list of NavigationEntries that gets replaced on the next navigation. A side effect of this is that we have an extra entry in the list before we load any page. This change also reverts the history related tests modified by 106 Adaptations that introduced this behavior. Fixes: QTBUG-117489 Pick-to: 6.5 Change-Id: I2738591b681082792544bd884f8ecec54ce9d72d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit f19aa5e343db66e5baacacd3c360c4cb00a01c7c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Try stablizing testsAllan Sandfeld Jensen2023-09-242-24/+12
| | | | | | | | | | | qmltests::WebEngineViewSingleFileUpload::test_acceptSingleFileSelection and tst_QWebEngineView::textSelectionOutOfInputField Change-Id: Ica3e91f109ae2a43bff9cd25e0da7d363823a762 Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit eeb5cdba78d0d64fd8bba4f0eb140f7e53ba6cfe) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add ImAbsolutePosition input method queryPeter Varga2023-09-181-0/+5
| | | | | | | | | | | | cocoa qpa uses it. Pick-to: 6.6.0 6.5 6.5.3 Fixes: QTBUG-115994 Change-Id: Ie9556169add96946b71299066b8db92bee23066e Reviewed-by: Anu Aliyas <anu.aliyas@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 4522eef20ba636a78937fd58bf8c0a8a5aafe648) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve tst_QQuickWebEngineView::savePage auto testPeter Varga2023-09-141-3/+9
| | | | | | | | | | | | | | | | | Use ScopedConnection to avoid "stack-use-after-return" address sanitizer error. Also reduce potential wait time in case of failure by waiting for accepted and finished states individually (same as tst_QWebEngineDownloadRequest tests). Fixes: QTBUG-116738 Task-number: QTBUG-56093 Change-Id: I49a60c95a816ae1b4cb6b227501ff81ca9c6f82b Reviewed-by: Anu Aliyas <anu.aliyas@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 9e8964001dcdc4c0dba4501ddcb599b86b5939e9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix invalid html in tst_touchinputMartin Negyokru2023-09-121-1/+1
| | | | | | | | | | | | | With the invalid 'width' attribute the input element defaults to a size that depends on the system (charmap) settings. It may result in failing tests that depend on the size of the element e.g. tests that use 'elementCenter'. Task-number: QTBUG-105342 Change-Id: I508d365fc4240d67d3e2240e8e33495c1de6ee4c Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 17bafdc301a057ed4b28dc3acc9bd636183683d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update qwebengineglobalsettings apiMichal Klocek2023-09-091-13/+13
| | | | | | | | | | | | | | Do comments from api review: * use static setDnsMode * use struct for mode and server templates * remove QObject * do not use QScopedPointer * use the namespace instead of the class Change-Id: I766626330e4cc190a170fcd6b5e32b1f60ad675c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 09e224c57c085457dbc5c2896aacb868a19c2ce6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Switch additional response header to QMultiMapAllan Sandfeld Jensen2023-09-011-1/+1
| | | | | | | | For consistency with other response headers, even if it is going to be inconsistent with existing request headers. Change-Id: I9e9c36ac20982d9c833486171fa9944c9059f471 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Switch response headers to QMultiMapAllan Sandfeld Jensen2023-08-292-3/+3
| | | | | | | | | | To allow duplicate key values and preserve order within multi key duplicates Change-Id: I8da0a3441255c9b72256d63f4ede10491c96c2dc Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit a6263a5e8d95dad6e3523f87d416a573e0420881) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QWebEngineUrlResponseInterceptor APIMichael Brüning2023-08-253-153/+0
| | | | | | | | | | | | | | | | | It has been found to not have any real effect, therefore, we remove it again to not release a non-functional API and create false expectations in users. This reverts commits 3f5de5fab74e6c152cdf5d04f3d893feaa31790b ab21f39c6a54be331dd8a155d3374bfe790e0274 (parts) 082eef1916a86d6d5e0c751d271c7c8a1a5e457d 5e257fb57a211f95556ec387fe6f262a60cbb6fe Task-number: QTBUG-61071 Change-Id: Ifb33e32128e77dfffed863a1a7501ba21796692d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 614c78c6385f6503dce597407c30fb63fa1de451)
* touchbrowser: remove a duplicate source fileMarc Mutz2023-08-231-261/+0
| | | | | | | | | | | | | | | | | | It's not actually used, ../../touchbrowser/touchmockingapplication.cpp is. I actually started editing this file when I noticed that nothing was changing. Do the next guy a favor and remove this stale file. Amends c89fcec0bcb65aae737f2dd733790f74e4303114. Task-number: QTBUG-100417 Change-Id: I4e08db66e62aaa1b7bcbfb61ea060881c16a48f2 Reviewed-by: Martin Negyokru <negyokru@inf.u-szeged.hu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit fbd6a3411fb8e7c64b2f11311f782b508a51f2f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add initial internal version pageMichal Klocek2023-08-145-2/+47
| | | | | | | | | | | | | | | | | | We kept urls in examples to point to company website. However this site is heavy to load and moreover it changes overtime leaving example screenshots obsolete. Introduce internal qt version web ui page which will be default page for examples and which displays basic information and can work offline. For start show version info and command line options for chrome://qt Change-Id: I0271ce6e7b152efe4942a6240b0c74ba382d5fcc Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit a748cb9183143b76cad1e940220dcabf25475493) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename disableReadingFromCanvas to follow naming styleAllan Sandfeld Jensen2023-08-113-8/+8
| | | | | | | | | | | | We prefer to name settings with Enabled at the end. From API review. Change-Id: I7aacc6dbb92d852fd21b067475d2fd9e7df56163 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Anu Aliyas <anu.aliyas@qt.io> (cherry picked from commit b10ac195de4dac7157575e2899cc19ec45fe1648) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve DNS-over-HTTPS configuration logicYigit Akcay2023-08-021-29/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves the DNS-over-HTTPS configuration and sets defaults for the general DNS logic. The following changes are included: - Insecure Chromium DNS client is always OFF (OFF is the Chromium default as well) - Add DnsMode::SystemOnly, which configures Chromium to only use the system DNS - The default DNS configuration is DnsMode::SystemOnly - Rename DnsMode::Secure to DnsMode::SecureOnly and DnsMode::WithFallback to DnsMode::SecureWithFallback to be clearer what each enum value does - Add error handling for invalid URI templates - Added test cases to handle the new logic - Some minor refactoring for cleanup purposes with the new defaults and logic taken into consideration - Some minor bug fixes Task-number: QTBUG-98284 Change-Id: Ie332166f8b5b83c8939af35e4eb8b69b417abdcf Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit a80b5d2299af8cea49ff0d2c02ae7632efe6d82b)
* Blacklist acceptNavigationRequestNavigationType again for qemuMichal Klocek2023-08-021-0/+3
| | | | | | | | | | | | e354d602e54 removes the test from balcklist however ci is blocked as test fails all the time now with 'expectedList.size() == page.navigations.size()' in tst_qwebenginepage.cpp(730) Change-Id: I6b2c1fbb5a6fa3c8ba3234e06501063638b309b8 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Martin Negyokru <negyokru@inf.u-szeged.hu>
* Do comments from api 6.6 reviewMichal Klocek2023-07-301-1/+1
| | | | | | | | | | | Additionally make destructor out of line in qwebengineurlrequestinterceptor as it mirrors qwebenigneurlresponeinterceptor. Change-Id: I0cdf7eae9faa671415359368560fb8f6aabf05fe Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit ab21f39c6a54be331dd8a155d3374bfe790e0274) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix blacklisted qemu-arm64 testsMartin Negyokru2023-07-289-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - test_findTextInterruptedByLoad: Remove whitespaces from the text as it takes lot of time to render according to perf. It should fix the timeout errors. - loadStartedAfterInPageNavigation: Remove the viewport meta tag from test.html. The 2x scale is only applied in embedded builds, it puts some elements out of the view. - acceptNavigationRequestNavigationType: Refresh the reload.html page only once. On qemu it may reload multiple times messing up the list of navigation types. - horizontalScrollbarTest: Skip instead of blacklist. - tst_qtbug_110287: Use an url that loads faster. Task-number: QTBUG-105342 Change-Id: Ifbd41885fee62b12f7022534f9b8bd5e20cbef01 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit e354d602e5459dc27e209a0e62aefc4107cc8903) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Stabilize tst_Accessibility::roles test on QEMU after Chromium 112Peter Varga2023-07-272-1/+7
| | | | | | | | | | | | | | The accessibility tree serialization may happen before the layouting is completed. This means that during the serialization some children may have not been created yet and results different roles for elements. It has been broken by enabling the TimedHTMLParserBudget optimization: https://crrev.com/c/4152859 Change-Id: I798a8ed5bd704a6900c7b56f462091b79a12815d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 91d2702481a7f865d85667a141d19066f4d9f7c7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disable error page for tst_QWebEngineLoadingInfo::responseHeadersPeter Varga2023-07-271-1/+3
| | | | | | | | | | The error page is not relevant for the test but it can significantly slow down the test because of the embedded javascript. Change-Id: I8b7e876f74110f758c5a23579018c598a29ba1e2 Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit d08e1f06121f943f75bf0d337ad857b1cbb7a94b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix geolocation permissions to use new Qt Permissions APIMichael Brüning2023-07-2613-3/+376
| | | | | | | | | | | | | | | | QtPositioningHelper now uses the Qt Permissions API. Also fixup the examples Simple Browser, Quick Nano Browser and Maps to use the right key on macOS and sign the application as part of the build process Moves the Geopermission auto tests to manual tests for webenginequick and webenginewidgets on macOS. Fixes: QTBUG-114939 Change-Id: Id6771889f20c866d2fcdbb477dbbb7da30367043 Reviewed-by: Anu Aliyas <anu.aliyas@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 3106a9ab7897cb3de9c640a7699d06e3f02a295d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adaptations for Chromium 112Allan Sandfeld Jensen2023-07-122-0/+3
| | | | | | | Change-Id: I1bb84b20a080d7f615bf0795ac2d97739e99ac1d Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 96abe0c83c7399cf771eb5155998c706a2243f0e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Stabilize qwebengineloadinginfo::responseHeadersAllan Sandfeld Jensen2023-07-121-1/+1
| | | | | | | | | The wait took too long. Rewrite it to be race safe, and increase timeoue. Change-Id: I18c8e17621502bfcfaa739d900ea64e33d0678f6 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> (cherry picked from commit 43990d33bb25ff88305ba0ed5d51a8bbf1bf5877) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Sync WebAction enums of QQuickWebEngineView/QWebEnginePageFriedemann Kleint2023-06-281-0/+1
| | | | | | | | Change-Id: Ibe750d541dba458f2278632355bcaf864fdc845a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michael Brüning <michael.bruning@qt.io> (cherry picked from commit aec0e99b5b7431740ab1e3ece40a137d6bc2a8c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* RenderWidgetHostViewQtDelegateItem: keep grabsShawn Rutledge2023-06-232-0/+68
| | | | | | | | | | | | | | | | | | | | If a WebView or WebEngineView gets a mouse or touch grab, we don't want to give it up to any handlers that may be lurking on Items underneath. WebView is opaque, so we don't know whether the user is trying to drag a scrollbar or something else, but interactive items outside shouldn't interfere, in general. [ChangeLog][QtWebEngineQuick] WebEngineView (or WebView backed by Qt WebEngine) no longer allows components outside to take over the mouse or touch exclusive grab. For example if the user starts dragging a scrollbar inside the web view, that continues until release, regardless of any DragHandler, Flickable etc. Fixes: QTBUG-103518 Change-Id: I4352dc8482020f0efc7a0901e94ccf7fc147fa1b Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 3feab861f5ead63e2a661343f0df2358fa0af894) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add PdfQuick dependency CMakeLists.txt for webengine autotestsAxel Spoerl2023-06-161-0/+2
| | | | | | | | | | | | The pdfquick subdir was added when the target Pdf was found. This breaks the build if PdfQuick is not compiled. => make adding the subdir conditional to PdfQuick. Change-Id: I9f46d4254c402f7f1dbde8a899edffd3f8b21c4e Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit abfb3c473ba5cd8b1ac33291ae2f5a80e26353a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Validate QNetworkProxy::applicationProxy configsMartin Negyokru2023-06-131-1/+15
| | | | | | | | | | | | | Invalid proxy settings may result in a crash in chromium. Use chromium's helper function that validates proxy configs instead of constructing net::ProxyServer manually. On invalid input, result will be a `SCHEME_INVALID` ProxyServer. Fixes: QTBUG-113992 Change-Id: I1745ae3c3cd4da40d3d8b92a14f752ac9b3f8d31 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 4a79ac857cb675abbd989f5b9ae21dea8016e74e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QWebEngineUrlResponseInterceptor: Small cleanupYigit Akcay2023-06-091-3/+3
| | | | | | | | | | | Make the constructor explicit, add explicit external destructor. Use QMultiMap instead of QHash for request headers, as those can potentially be repeating. Change-Id: Id1730b015971287e63562ac67cfa964f2abbb7cc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 082eef1916a86d6d5e0c751d271c7c8a1a5e457d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crashes on sendEvent on 'invalid' key.textMichal Klocek2023-06-081-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | A user can create QKeyEvent which may have too long QKeyEvent::text and does not fit into null terminated blink WebKeyboardEvent::text. Till now the text was mem copied however without null-termination if it was too long (which is char16_t[WebKeyboardEvent::kTextLengthCap]) It seems that real keyboard events do not generate any 'key.text' for modifiers, however user can provide any text (for example in the form of 'shift' 'control'). Therefore 'alt' still worked as we had 16 bytes of space but 'shift' was already too long. In case we can not fit into blink web keyboard event text with null terminated string simply skip the text as it is not there in the first place in case of non-user generated key events. This way the text is always null-terminated. Fixes: QTBUG-113704 Change-Id: Ib1560a44e7451ab7d886c72338b7433fc51318ed Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit fb9bc02df6114ae9de15ae8267fc2dac79144aa0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>