summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Stabilize tst_qwebenginedownloadsJüri Valdmann2018-04-038-558/+619
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The waitForRequest/waitForSignal function used by these tests is broken: it assumes that calling QEventLoop::exit() will immediately exit from the event loop. In actuality this is not immediate and the event loop may continue to execute more signals handlers even after exit() has been called. This means that in e.g. waitForRequest the 'result' variable may be assigned to twice. Additionally there is a race condition in downloadTwoLinks, where we sometimes skip the first download. This is not a bug but simply one pending navigation being aborted in favor of another. Changes - Delete waitForRequest. Define one HTTP request handler per test, using state variables to communicate with the main body of the test. Ignore unknown requests (including favicon requests). Same for downloadRequested signals. - Expand downloadTwoLinks and fix expectations. - Add logging to HTTPServer. - Unblacklist. Task-number: QTBUG-66888 Change-Id: I718cac6c4b32a8cc68400fa8ee5b853686c77fcb Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Add tst_qwebenginescript loadEventsJüri Valdmann2018-04-033-39/+115
| | | | | | | | | | | | | | Replace injectionPoint test with a timeout-less version that uses - both a single-frame and a multi-frame page - both main and isolated worlds - cross-process navigation - window.open - profile-wide scripts Task-number: QTBUG-66338 Change-Id: Ica4acb8ada4acc38aa5e1ca00e7512a2e69b785f Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Un-blacklist tst_QWebEngineView::mouseLeave auto testPeter Varga2018-03-262-4/+1
| | | | | | | | | Moving mouse cursor to (0, 0) by QTest::mouseMove() doesn't seem to work and the cursor doesn't leave the QWebEngineView. Change initial coordinates as a workaround. Change-Id: Iaad895c770a6edc5ed6e375f68b2b56196d84073 Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
* Make WebChannelIPCTransport into a RenderFrameObserverJüri Valdmann2018-03-221-8/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 63, Chromium creates proxy frames also for the main frame in the frame tree during cross-process navigations. This leads to a segmentation fault in WebChannelIPCTransport because we assume that all main frames are local. See https://crrev.com/27caae83cb530daaf49f9a38793e427cdf493a65 for details. This patch refactors the renderer-side WebChannelIPCTransport from a RenderViewObserver into a RenderFrameObserver, which prevents the segmentation fault since the RenderFrameObserver is not created for proxy frames. Most likely this would have to be done eventually anyway since the RenderView and RenderViewObserver classes are deprecated and will likely be removed as part of the Site Isolation project. Installation is changed to follow Chromium's RenderFrameImpl in the sense of performing the installation from RenderFrameObserver::DidClearWindowObject instead of ContentRendererClient::RunScriptsAtDocumentStart. This has the benefit of avoiding the ScriptForbiddenScope DCHECK. Additionally there are the following minor changes: - The deprecated parameterless version of v8::Value::ToObject() method is replaced with v8::Value::IsObject() check and v8::Local::Cast. - The deprecated v8::Handle typedef is replaced with v8::Local. - The deprecated single-parameter WebContentsObserver::OnMessageReceived is replaced with the new two-parameter version. - blink::MainThreadIsolate() is used instead of v8::Isolate::GetCurrent() for Install/Uninstall since we know we are executing on the main thread. - WebChannelIPCTransportHost is changed to ignore messages from unexpected renderers in case something goes wrong with the renderers. - Logging is added to WebChannelIPCTransportHost for debugging purposes. Some new unit tests are added, all of which fail with the old version. Task-number: QTBUG-66333 Change-Id: I936d142fb042d9f936a3f9d08d4328ecba595f1f Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Unskip loadInSignalHandlers testMichal Klocek2018-03-181-13/+7
| | | | | | | | Remove testing of provisionalLoad, use QTRY_COMPARE(spy.count()) instead of spy.wait() to determine number of actual calls. Change-Id: I37cbca8f27d4e12d42c7b30b8362249c1f76c79e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Switch cookie-filter API to std::functionAllan Sandfeld Jensen2018-03-162-4/+4
| | | | | | | | | Allows us to use return value instead of magic properties Task-number: QTBUG-66825 Change-Id: I55202a7aca2e662bc214b05caf767d2da496f026 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Blacklist downloadTwoLinks generallyAllan Sandfeld Jensen2018-03-151-1/+1
| | | | | | | It is more flaky with 65-based, so blacklist it until fixed. Change-Id: I580dd858068b1ad54203618bd241294d17010a19 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations to form validationAllan Sandfeld Jensen2018-03-152-121/+0
| | | | | | | | Form validations messages has moved entirely to being done by Blink. Change-Id: I6742c111fc59f0baba75b8b37f5d0ec9ae2fb920 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Basic adaptations for 65-basedAllan Sandfeld Jensen2018-03-153-6/+8
| | | | | Change-Id: I121b14d6a44e80f5eea4b159c58f7010d472926e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Remove credentials from view-source URLsPeter Varga2018-03-142-0/+62
| | | | | | Task-number: QTBUG-65997 Change-Id: Icb55326c51f1dfff77e8e862e9ced619be17ead1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Stabilize WebEngineViewLoadUrl::test_stopStatusPeter Varga2018-03-141-6/+14
| | | | | | | | | | After stopping the load the active URL should be the url of the previous successful load. Test active URL properly to make the test independent from the previously executed test. Change-Id: I53800fe28a722a5f3554b1ff2d4fc31cb8638dfd Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix loadStarted signal after an in-page navigationv5.11.0-beta2Peter Varga2018-03-081-0/+26
| | | | | | | | | | | In-page navigations does not trigger loadFinished thus m_lastLoadProgress is not reset to -1. Do not ignore loadStarted signal if m_lastLoadProgress is set to 100 because it can mean a new navigation after an in-page one. Task-number: QTBUG-66869 Change-Id: I2b556fe7e3e097c338bdd7ca47e7384722e7eca9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Rename protocol() to scheme() in QWERPHPermissionRequestJüri Valdmann2018-03-082-4/+4
| | | | | | | | | Scheme refers to a part of a URL. Protocol refers to a formal standard for communication over a network. Therefore scheme is more accurate here, since registerProtocolHandler only defines simple aliases. Change-Id: I71a1511aa92e41c3e3aca4c0403f54af6d91c563 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Move quota and registerProtocolHandler permission classes to coreJüri Valdmann2018-03-081-12/+14
| | | | | | | | | | | | | | | | | | | | | | | - Move QWebEngineQuotaPermissionRequest and QWebEngineRegisterProtocolHandlerPermissionRequest to QtWebEngineCore. - Delete QQuickWebEngineQuotaPermissionRequest and QQuickWebEngineRegisterProtocolHandlerPermissionRequest. Miscellaneous cleanup: - Mark QWebEngineQuotaPermissionRequest constructors as internal for QDoc. - Remove superfluous Q_DECLARE_METATYPEs (implied by Q_GADGET). - Remove Q_UNREACHABLE from default constructor. For some reason QML seems to default construct an unused temporary object before throwing it away and copy constructing the actual object. This triggers Q_UNREACHABLE. Change-Id: Icf9f4e34996e4c64aec65b734bcb3bbd22b4dc51 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Stabilize WebEngineViewLoadHtml::test_loadProgressAfterLoadHtmlPeter Varga2018-03-081-1/+9
| | | | | | | | | | | The previous test will set the webEngineView.loadProgress to 100 due to a successful load. Therefore, the test can't expect 0 loadProgress at the beginning. Count the loadProgress changes instead of checking the initial value. Change-Id: I8f4727d5b8c7ebf1b7c640e44a9eb3ca5a7fef44 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Blacklist tst_qwebenginedownloads on macMichal Klocek2018-03-081-0/+4
| | | | | | Task-number: QTBUG-66888 Change-Id: I11a1526bf6478fc5ffb51f208b59cff7d9a37220 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Also blacklist microFocusCoordinates on OS X 10.11Allan Sandfeld Jensen2018-03-081-1/+1
| | | | | | | Also flaky there. Change-Id: I48a5b497de3b7cbbc1a71413db370777d0daa78f Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Blacklist tst_QWebEngineView::microFocusCoordinates on macOS 10.12Michael Brüning2018-03-061-0/+3
| | | | | | | | | It was failing consistently. Blacklist for now and fix as soon as possible. Task-number: QTBUG-66873 Change-Id: Iab314a3e650e7c20fae3ca74ff2db202c5d5fe7d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Blacklist mouseMovementProperties test on WindowsAlexandru Croitor2018-02-221-0/+1
| | | | | | Task-number: QTBUG-66527 Change-Id: I2d2c427d5a2e07247222772772ba265e0a153b85 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Expose actual URL for data URLs instead of the virtual URL in the APIPeter Varga2018-02-212-0/+38
| | | | | | | | | | | Chromium considers the actual URL as "scary" therefore prefers to pass a simpler URL via the WebContents::GetVisibleURL() content API function. For data URLs, use the actual URL instead to keep their anchor information. Task-number: QTBUG-64972 Change-Id: I74db3e5dd22a728656a58e50a4e3fba93b82dae2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fixup merge of downloadType from 5.10.1Allan Sandfeld Jensen2018-02-211-19/+38
| | | | | | | | | | | | | In 5.11 we deprecated downloadType and at the same time ripped out most of the faulty logic. Later we partially fixed the logic in 5.10.1, but kept the 5.11 version during the merge. This restores the improved logic from 5.10.1, while keeping the property deprecated since it is still misleading at times. Change-Id: I12ee09a2b212506f7ba1a336c9c2e88aa3b1de24 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Stabilize tst_QWebEngineDownloads::downloadTwoLinksAllan Sandfeld Jensen2018-02-162-40/+38
| | | | | Change-Id: I217fd42c7fa822998ed2e1ebfe952a1f2d505ffc Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Merge remote-tracking branch 'origin/5.10' into 5.11Allan Sandfeld Jensen2018-02-151-2/+2
|\ | | | | | | Change-Id: I2169baef0a8adb5523d2cfe58896199e967ac1b7
| * Disable failing developer build tests for QemuSami Nurmenniemi2018-02-051-2/+2
| | | | | | | | | | | | Task-number: QTBUG-63152 Change-Id: I7016195c43ba308153d4748a6f9837f1772e762d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix undefined reference to qCompare errorJüri Valdmann2018-02-132-2/+2
| | | | | | | | | | | | | | | | | | | | | | Linking against qtbase 5.9 fails with error: undefined reference to 'bool QTest::qCompare<QString, char [13]>([...])' due to QCOMPARE of QString with C string literal. Change-Id: If4f4312d21d0b1a8ce2577d5f9d3a9ac0731b3a2 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Add support for registerProtocolHandlerJüri Valdmann2018-02-133-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend initialization of URLRequestContextGetterQt to create a content::ProtocolHandlerRegistry for each content::BrowserContext and add the registry's URL request interceptor to the front of the interceptor chain. Implement methods in WebContentsDelegateQt to add/remove protocol handlers to/from the ProtocolHandlerRegistry. Add permission request signal and classes for core, quick and widgets. Add widgets autotest. Add signal handlers to quicknanobrowser and simplebrowser. Task-number: QTBUG-62783 Change-Id: I808e7eb9a1cb4d7216686deed4895de14fe46310 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.10.1' into 5.11Liang Qi2018-02-122-1/+10
|\ \ | | | | | | | | | Change-Id: If971fbfcb158c921e2328dfcdef3bd3322f30c4b
| * | Blacklist flaky qwebenginedownloads testv5.10.1Michal Klocek2018-02-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This test suffers for out of order handling of network requests. To speed up release blacklist flaky tests. Change-Id: Ifafc4f429b7a2bb8cd4b5c786143b689657cc753 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | Fix race condition in tst_QWebEngineDownloads::downloadTwoLinks()Allan Sandfeld Jensen2018-02-081-1/+6
| |/ | | | | | | | | | | | | Accept the two requests might come out of order Change-Id: I313506d975ebf007fce3cd857baa742866b8f38b Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Correct documentation for storage pathsMichal Klocek2018-02-121-10/+44
| | | | | | | | | | | | | | | | Udpdate docs and profile unit test for storage paths. Change-Id: I646a33571ad8458af4efcddf310489cdde3a4606 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Allan Sandfeld Jensen2018-02-064-426/+65
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2018-02-024-426/+65
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/download_manager_delegate_qt.cpp src/core/download_manager_delegate_qt.h src/core/render_widget_host_view_qt.cpp src/core/web_contents_adapter.cpp src/webengine/api/qquickwebengineview.cpp tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp Change-Id: I2308414ce257ae5bb0fc9f6493aa111a267ff39b
| | * Rewrite and activate multiplePageGroupsAndLocalStorageAllan Sandfeld Jensen2018-01-251-42/+39
| | | | | | | | | | | | | | | | | | | | | Convert it to QtWebEngine. Change-Id: I7a453cd7544a20a9c461c3bb29b3a2fb78016d44 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| | * Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Allan Sandfeld Jensen2018-01-241-4/+4
| | |\ | | | | | | | | | | | | refs/staging/5.10
| | | * Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2018-01-241-4/+4
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/download_manager_delegate_qt.cpp Change-Id: Ica57e582a323c6bd014a64bb615dd9454e656548
| | | | * Fix QWebEngineDownloadItem::type()Jüri Valdmann2018-01-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-62640 Change-Id: I2b16f24533b38c20a7071319723382ba240e35f3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| | * | | Fix thread synchronization issue in tst_qwebengineprofileJüri Valdmann2018-01-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I7b7c4a6501387b1d657e55f222908365990b8fef Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * | | Remove test relying on WebKit internalsAllan Sandfeld Jensen2018-01-241-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test makes little sense for QtWebEngine Change-Id: I0177fb59ea23383a3c8135853f7e62b26ce5708a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| | * | | Remove dead tests we will not be reusingAllan Sandfeld Jensen2018-01-241-360/+0
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | We have no plans of implement QtWebKit still plugins. Change-Id: I9f7bb94cc240e2f0eda8c85c03fa5860435d52a3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| | * | Re-enable setUrltoEmpty and setUrlHistory testsAllan Sandfeld Jensen2018-01-231-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Have been skipped for years but appears to work. Change-Id: I461459b64fe3731b2fb50a3cc9c9d4ab75b135d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * | Remove full blacklist of osx 10.11Allan Sandfeld Jensen2018-01-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was added for a single test failure that was caused by a screen locker on the CI, a problem that has since been solved. This CI configuration is the only one that's running qmltests on osx. Change-Id: Ia6f11649ce2f63000488aa18080c5d149d04eac0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| | * | Deselect text on each fourth clickSzabolcs David2018-01-221-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Triple click selects the entire paragraph and it should be deselected on a quadra click. Task-number: QTBUG-65649 Change-Id: I87c9405a202d8b6eacd7c19dbbcb051756c41220 Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | | Merge remote-tracking branch 'origin/5.11' into devAllan Sandfeld Jensen2018-02-024-1/+147
|\ \ \ \ | |/ / / |/| | | | | | | Change-Id: I454bb7216b013cc9aa9ee660893fe37034fd50e1
| * | | Expose JavascriptCanPaste attributeKai Koehne2018-02-023-1/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose an attribute to enable the execCommand("paste") functionality, which is by default disabled due to security concerns. [ChangeLog][General] Added JavaScriptCanPaste attribute that enables JavaScript 'execCommand("paste")'. Task-number: QTBUG-64056 Change-Id: I1a414021e020473dd15946fff91fb103d871e961 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * | | Blacklist unstable test_viewSourceAllan Sandfeld Jensen2018-02-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ib7562c716faa4221211f2bf53e5f3401b1ee492d Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | | | Support regex format include rules in user scriptsPaul Clark2018-01-262-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For user scripts with `@include` and `@exclude` directives in their headers, if the value starts and ends with `/` then assume it is a regular expression to be matched against a URL. This feature has been in the original greasemonkey module since 2011 and currently in webengine regex include rules are being blindly passed to the glob matcher. An alternative to this approach of leaving the bracketing slashes on the values as a kind of in-band signalling (and making the glob escaping conditional) would be to add new members to the UserScriptData struct for holding regex patterns. This commit also applies cleanly to v5.8 and every release after it. [ChangeLog][][UserScript] User script metadata parsing now supports regular expressions in @include and @exclude rules. Task-number: QTBUG-65484 Change-Id: Ie2e483419f6784f995131ffb7d2d5e91c2c55b1d Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | | Test adaptations for Chromium 63Allan Sandfeld Jensen2018-01-258-45/+58
| | | | | | | | | | | | | | | | | | | | Change-Id: I19bf693fb3916a78f4a199e6e095ca58b8fdfa27 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | | | Adaptations for Chromium 63Allan Sandfeld Jensen2018-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I551c7091bbc0463bed94180313eb2bfe92f0ad84 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | | | Adaptations for Chromium 62Allan Sandfeld Jensen2018-01-254-12/+9
|/ / / | | | | | | | | | | | | Change-Id: I49cd3c419d4dd1180144c3c07bdd9a628ab73caa Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | | Fix tst_QWebEnginePage::setUrlToBadDomainAllan Sandfeld Jensen2018-01-221-2/+2
| | | | | | | | | | | | | | | Change-Id: I54e7633fdfd1f3a4574373e0469c3df733dd32a4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>