summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Speculative stabilization of tst_QWebEngineView::emptyInputMethodEventPeter Varga2017-09-211-4/+4
| | | | | Change-Id: I5dd8c3251587c706f1fd3b90f77e4ac03c2fba97 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Speculative stabilization of imeCompositionQueryEvent widget auto testPeter Varga2017-07-191-5/+7
| | | | | | | | Wait for receiver object to be set after show. Task-number: QTBUG-61816 Change-Id: I2eb62775d30b0f8f9ec3e76d60a924b56c811865 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix propagation of unhandled key press eventsJoerg Bornemann2017-07-141-1/+10
| | | | | | | | | | | | | | | Unhandled key presses for printable keys were not received by the parent widget anymore. This was a regression from 5.8.0. The propagation is suppressed if NativeWebKeyboardEvent::skip_in_browser is true. Commit 4501b9d8 accidentally removed the wrong skip_in_browser assignment. Task-number: QTBUG-61621 Change-Id: I7eafa1fac5fb9a7edc4af2bc1aac21c106264713 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Fix cancelling IME compositionPeter Varga2017-06-221-2/+26
| | | | | | Task-number: QTBUG-61429 Change-Id: I936f1c924ae8158a5243fdf20d12e6c5508b684a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Override shortcuts only when an HTML input field has focusJoerg Bornemann2017-06-081-9/+12
| | | | | | | | | | | | | | | | Otherwise an application shortcut like Shift+Delete would no longer work when webengine has focus (e.g. "delete mail" in KMail) This removes unconditional calls to editorActionForKeyEvent for ShortcutOverride event handling. We can remove those, because the key sequences that are checked by editorActionForKeyEvent are a subset of the key sequences checked by isCommonTextEditShortcut. This amends commit 3902b27e. Change-Id: I12a98368381edef36f11457c8b864d843efb871a Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add back widget auto tests for inputMethodQuery and inputMethodHintsPeter Varga2017-05-311-111/+110
| | | | | | Task-number: QTBUG-55766 Change-Id: Ic90eb7b9a211b09281ccbb3eae727e8a1c081b9a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix selectionChanged signal out of input fieldPeter Varga2017-05-171-2/+93
| | | | | | Task-number: QTBUG-60688 Change-Id: I6d0b78e6b8df54c40ae30d5f0909c631c440a9cd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Stabilize keyboardEvents auto testsPeter Varga2017-04-281-1/+1
| | | | | | | | The typeAheadTimeout is set to 1sec in Blink. Wait a bit more when selecting the next option in a HTML select element in auto tests. Change-Id: Ia3d9fde05b4d6cde9186aaa701ca48354ca74b4d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Override shortcuts in HTML input fieldsJoerg Bornemann2017-04-251-0/+58
| | | | | | | | | | | | | | | | | | | When users defined a single-letter short cut it was not possible to type this letter in HTML input fields. Fix this by accepting ShortcutOverride events whenever the web page is editing text. Use QInputControl::isCommonTextEditShortcut for Qt 5.9 and later. For the case where QtWebEngine is built against an older Qt a duplicated code path is used. Also, ensure users do not override web action short cuts. Task-number: QTBUG-59053 Change-Id: Ic26cf2a040a72b118273c6645c00b2913b995b0b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Disable setting background color in QInputMethodEventPeter Varga2017-04-211-0/+6
| | | | | | | | | | | | | IME managers may set background and foreground color of the composition string. Since there is no Chromium API for setting the foreground color, changing the background color to black may produce "black-on-black" text. Chromium locks the background color to transparent thus we do the same in this fix. Task-number: QTBUG-58362 Task-number: QTBUG-60031 Change-Id: I939c8aaaa847de191890d6924ba3c7652465f8a0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Handle QInputMethodQueryEvent forwarded by RWHVQDWPeter Varga2017-04-121-0/+80
| | | | | | Task-number: QTBUG-58362 Change-Id: I6c80c8063ccad97aa80aff8ee44aa10a899c5ff5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix text selection and input method queryPeter Varga2017-04-121-0/+385
| | | | | | | | | | | | | | | Instruct the render process to change the text selection if it was requested via an input method event. Raise the selectionChanged() signal when all the corresponding input method properties are set. Moreover, add back the remaining input method widget auto tests. The updated tests are moved to the QWebEngineView tests since the corresponding APIs (inputMethodQuery() and input event handling) are now available via the QWebEngineView's focus proxy (aka RWHV). Task-number: QTBUG-55766 Change-Id: Ia0022d5f38b31dd59b084ff42e4abc2780ae90ec Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add back tst_QWebEngineView::horizontalScrollbarTest auto testPeter Varga2017-03-291-18/+19
| | | | | Change-Id: Iebe5ed3e93b5b39866910ad9b63d02b88d64c3b2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Unblacklist changeLocale auto testsPeter Varga2017-03-151-3/+3
| | | | | | | | | | Do the error message comparison with utf-8 enconding since the localized error messages are stored in utf-8 format (error_page_strings.grdp). This also stabilizes the test because it doesn't depend on the encoding used by the Chromium. Change-Id: I24addc1c18d5b4325f4c0270e675e02c3f4e0812 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Allan Sandfeld Jensen2017-03-041-0/+50
|\
| * Merge remote-tracking branch 'origin/5.8' into 5.9Allan Sandfeld Jensen2017-03-021-0/+50
| |\ | | | | | | | | | Change-Id: Iff6ab3c287c58d8ec84a1513460bfce5218e8a61
| | * Fix QWebEngineView::setFocus to properly set internal QQuickItem focusAlexandru Croitor2017-02-201-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The widgets object hierarchy related to focus goes like this: QWebEngineView's focus proxy is -> RenderWidgetHostViewQtDelegateWidget, which has an internal QQuickRootItem defined by QQuickWidget, and the child of the item is -> RenderWidgetHostViewQuickItem. Previously when QWebEngineView::setFocus was called, the focus was set on the RenderWidgetHostViewQtDelegateWidget and the QQuickRootItem, but not on the RenderWidgetHostViewQuickItem. This caused for e.g. an active HTML text input not receiving focus. Make sure the RenderWidgetHostViewQuickItem is marked to have focus within its root item, so that if the root item receives active focus, so will RenderWidgetHostViewQuickItem receive it. Task-number: QTBUG-58515 Change-Id: I175610e3dfebc03733aefe26c16f47096df8ff5b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Rework change locale tests for 55-based ChromiumPeter Varga2017-03-031-23/+27
|/ / | | | | | | | | | | | | | | | | Error pages no longer have useful titles in Chromium 55. Test the error page content instead. Tests have been also stabilized. Task-number: QTBUG-58022 Change-Id: If5c3e2b1df2cb3ee8b48d651e6f19360fa484f17 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Rework unhandled key event propagation tests for 55-based ChromiumPeter Varga2017-03-011-16/+27
| | | | | | | | | | | | | | | | | | Since change https://codereview.chromium.org/2200833007 input elements are inappropriate for testing unconsumed key events. Test focus change on div elements instead. Change-Id: Ifa2f3e1bc9d6d9cb396fbad7caea907616d085b7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Update auto tests for Chromium 55Allan Sandfeld Jensen2017-03-011-0/+1
| | | | | | | | | | | | | | | | | | Load failures now have a Chromium side timeout of 10s so we need to wait longer than that. Additionally error-pages no longer have descriptive titles, so we can not rely on that in our tests any longer. Change-Id: I33ac8b9f1247403eb214f7260267edb887fe10d0 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-301-0/+100
|\| | | | | | | Change-Id: Ic36a80502730d404ab96dfa11ff1eb0ac6eb302d
| * Fix confirming IME composition and newline insertionPeter Varga2017-01-251-0/+100
| | | | | | | | | | | | Task-number: QTBUG-55766 Change-Id: I3be3b224dfef9ecc1ce39f4f20ec5c1d13c0fa69 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-251-0/+167
|\| | | | | | | | | | | | | | | Conflicts: src/3rdparty tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp Change-Id: I070173576fc4be53689ce0dd9e1fd4133f5814da
| * Fix handling of empty input method eventsPeter Varga2017-01-221-0/+29
| | | | | | | | | | | | Task-number: QTBUG-55766 Change-Id: I4e6ade8f000f66ff1bb28f3b856ae140834292f1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Make input method hints available via RWHV delegate widgetPeter Varga2017-01-201-0/+26
| | | | | | | | | | | | | | | | | | Moreover, set ImHiddenText hint for password fields and add back the corresponding widget auto test. Task-number: QTBUG-55766 Change-Id: I3f76e19c8c33e11f3d9f515b6dc7d6e998c3c9a4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Add back SIP (Software Input Panel) widget testPeter Varga2017-01-181-0/+112
| | | | | | | | | | | | | | | | | | Moreover, update the Chromium SHA1 for enabling virtual keyboard support for macOS. Task-number: QTBUG-55766 Change-Id: Ic50ae79ab13a62a4b9289afedce2d6647e266f86 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add methods to issue various types of HTTP requestsViktor Engelmann2017-01-111-0/+135
|/ | | | | | | | | | | | | Added class QWebEngineHttpRequest, which describes a GET or POST HTTP Request. Also added overloads of method "load" to QWebEngineView, QWebEnginePage and WebContentsAdapter, which issue such a request. These can be used for example to simulate form-submissions. Task-number: QTBUG-53314 Task-number: QTBUG-53372 Change-Id: I85ac8cdd3d1557905b35e3172b922aba356d1c41 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Port autotests from own waitForSignal() to QSignalSpy::wait()David Faure2016-11-291-12/+20
| | | | | | | | 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>
* Fix keyboard focus of RWHVQDW after popupPeter Varga2016-11-291-0/+59
| | | | | | Task-number: QTBUG-56652 Change-Id: I1a6655587a9104dd817332e2eb5f886c057d8f64 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add quick and widget auto tests for keyboard event handlingPeter Varga2016-10-251-0/+90
| | | | | | Task-number: QTBUG-56242 Change-Id: Ib6689d6f183532502382c86f92fdbdf27dd6c37c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add support of colored underline and background to InputMethodEventPeter Varga2016-09-231-0/+65
| | | | | | | | | | Moreover, unskip and update inputMethodsTextFormat widget auto test and move it to the tst_QWebEngineView tests. New manual test has been also added for testing input methods format. Task-number: QTBUG-55766 Change-Id: I4c71e15cb426925f76c770266a3c20f1cc12b687 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add focusOnNavigationEnabled settingAlexandru Croitor2016-08-091-0/+86
| | | | | | | | | | | | | | | | The focusOnNavigationEnabled setting allows changing the behavior of whether a WebEngine view (widget or quick) will automatically get focus, whenever a navigation action happens (load, reload, previous history entry, etc). The default behavior before this patch was to always grab the focus. [ChangeLog][QtWebEngine][General] Add focusOnNavigationEnabled setting which allows controlling whether a web view will receive focus on a navigation request. Previously the view always received the focus. Task-number: QTBUG-52999 Change-Id: I6d30d973a41b53011131f21dcecbf6ec4d652759 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix changing locale of ResourceBundle on LinuxPeter Varga2016-07-131-0/+32
| | | | | | | | | | | | | | | | The ResourceBundle is not re-initialized for new Renderer Processes because it is initialized only once in Zygote Process. This means runtime locale changes do not affect new Renderer Processes. Zygote Process is supported on Linux only thus other platforms don't need this fix. With this change the locale of the ResourceBundle is reloaded when new Renderer Process is started. For accessing the pak file of the locale in the sandboxed environment the file descriptor is passed via the Chromium's GlobalDescriptor solution. Task-number: QTBUG-53000 Change-Id: I57e84078db9d0795d16d930aa1b3e93a6e86ec39 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Switch to using QQuickWidget in WebEngineWidgetsAllan Sandfeld Jensen2016-07-061-9/+7
| | | | | | | | | To support scenegraph-ng we need to switch away from QOpenGLWidget, to something that will work with any QQuick backend. Task-number: QTBUG-53283 Change-Id: I476a2c22e35a18cefc2824d5342bcff874c44d28 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-05-311-0/+152
|\ | | | | | | Change-Id: I561c00b3a844ab493a5bf0148a5923662842cf5d
| * Disabled WebEngine views should not receive focus.Alexandru Croitor2016-05-261-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if a QWebEngineView or a QQuickWebEngineView is disabled using setEnabled(false), after loading a web page, the views are automatically focused, and a user might see a blinking caret in an html input for example, even though the user can't interact with it. Fix consists in not calling the Focus() method whenever a view is disabled. Change-Id: I1014fb5898a5ddf01a4e9b14c3eaf5d4006e5131 Task-number: QTBUG-53159 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
| * Stop disabled QWebEngineView widget from processing input events.Alexandru Croitor2016-05-261-0/+120
| | | | | | | | | | | | | | | | | | | | | | If a QWebEngineView is disabled, input events are still forwarded to Chromium, thus allowing the user to interact with a web page. Fix consists in stopping the forwarding of input events in the generic event handler, just like QWidget::event() does. Change-Id: Ie822d1f3d640840569a282223d76749686cf3419 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
* | Cleanup license leftoversMichal Klocek2016-05-031-1/+1
| | | | | | | | | | Change-Id: Ie0ecb1808c6b6a689ef29d7fa4831ca0a2e92721 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Move printToPDF to pageAllan Sandfeld Jensen2016-02-251-19/+0
| | | | | | | | | | | | | | | | | | The API needs nothing from view and view just forwards it to the page anyway. This is an page level API, this also makes it work without being shown. Change-Id: I3b8555ab472ec2c7632db3655bcc31925fcfa001 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add rudimentary printing API and add it to example.Michael Bruning2016-02-161-0/+21
|/ | | | | Change-Id: I48141d07e9744bb21d64a5c8724579cb469ba35c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Remove unnecessary test ifdefAllan Sandfeld Jensen2015-09-211-2/+1
| | | | | | | We have settings and plugin setting now. Change-Id: Id999c20a0e1d5d2b7272207827de8fd31377ba01 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Propagate unhandled key events to the QtWebEngine view's parentJocelyn Turcotte2015-02-051-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | This allows applications to receive unhandled key events from the page by setting an event handler on the view's parent widget/item, like it was possible with QtWebKit. This is different in that events first have to asynchronously go through the QtWebEngineProcess. If the WebEngine view has the keyboard focus, the events will be consumed inconditionally by the RenderWidgetHostViewQtDelegates, and a copy will be resent to the view's parent if it wasn't consumed. This sends it to the parent instead of the QWebEngineView directly since those are only unhandled events, unlike with other widgets where you can first intercept events. It is done that way also in cases where the QWebEngineView would be be the focus widget directly in the future, instead of the RWHV. If applications want to intercept key events before they reach the page, they need to use an event filter on the QWebEngineView's children or globally on the application. Change-Id: I3b48f5212d3f238a1c0497cec1db6ae3badbad26 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Do away without QWebEngineWidgets::initializePierre Rossi2014-08-041-1/+0
| | | | | | | | | If we consider the plugin scenario is unlikely and decide it's unsupported for widgets, we can simplify our tests and examples a bit on this front. Change-Id: Idc96032c127b4ee74fb5c7b3d2cdfdf99c3a722e Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix tst_QWebEngineView::crashTests test caseSzabolcs David2014-04-151-1/+1
| | | | | | | | | | This test runs without crash, but fails because the expected interval of the load progress is too narrow. For example, the progress values in my case: 0 -> 10 -> 100 Change-Id: I0fd13d6badf717fc27e8d4219f39190db0090692 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Render the widgets view using the scene graph into a QOpenGLWidgetJocelyn Turcotte2014-04-081-0/+1
| | | | | | | | | | | | | | | This means that widgets application now need to setup the GL context sharing as well. QWebEngineWidgets::initialize() must be called, which has the same effect as QWebEngine::initialize(). The QtWebEngineWidgets now depends on the QtWebEngine module to make this happen. Since QOpenGLWidget is only available in Qt 5.3, this patch also disables the webenginewidgets module completely when building using Qt 5.2. Change-Id: I0e99a779d1eb080f2ccf5a338ff0763ad64e6eba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Unskip and ajust tests using setHtml, setContent, toHtml and toPlainTextJocelyn Turcotte2014-01-221-4/+2
| | | | | | | | | | Replace direct calls of toHtml and toPlainText to use a blocking helper function that spins a QEventLoop to wait for the async result. This should work fine for tests where the event loop is less polluted by other events that could cause code reentrancy through stacked stacks. Change-Id: Ic46a06a9abad782a39a620ceecdc51c3bbb6b5a1 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Turn on to run all widgets tests by make check. Move widgets test to tests/auto.Adam Kallai2013-10-141-0/+552
Change-Id: If3617d86ea44f665a44a54b6ba57935b69220a9e Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>