summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
Commit message (Collapse)AuthorAgeFilesLines
* Stabilize failed load sub-test of urlSchemeHandlerAllan Sandfeld Jensen2016-02-051-3/+3
| | | | | | | | | | When a failed load is replaced by an error-page we currently get two loadFinished signals. So disable error-pages to make the test of failed load simpler. Change-Id: I3baaf0f5a06c5e755695d6540316287a860e0d5f Task-number: QTBUG-50752 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* OS X: Fix crash when setting a custom default QSurfaceFormat.Alexandru Croitor2016-02-045-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting a new default QSurfaceFormat after QtWebEngineCore::initialize() is called, might lead to a crash. This happens when the new surface format has a different OpenGL profile, compared to the profile created by web engine in the RenderWidgetHostViewQtDelegateWidget constructor. The default constructed QSurfaceFormat has an OpenGL Compatibility profile. Inside the Cocoa platform plugin when a new shared OpenGL context is created, it fails to initialize the new context because of the difference in profiles, and thus ultimately creates an unshared context, which leads to a crash. Fix consists in using the shared context QSurfaceFormat in the RenderWidgetHostViewQtDelegateWidget constructor, and also printing a fatal warning to notify the developer only to set the new QSurfaceFormat before the application instance is declared. Bottom line, if the QSurfaceFormat OpenGL profile has to be changed, it should be done before QtWebEngineCore::initialize() is called. Doing so after initialize() is called, will lead to a crash. Change-Id: I8a07211b592143d736b001556b944d4759802396 Task-number: QTBUG-50665 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
* Stabilize tst_QWebEngineProfile::urlSchemeHandlers some moreJoerg Bornemann2016-02-041-0/+2
| | | | | | | | | Work around QTBUG-50752 in URL scheme handler test. Triggering the failing load makes subsequent calls to toPlainTextSync unreliable. Change-Id: I370d59b935b186fa4e3be3097ee921802f951720 Task-number: QTBUG-50752 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Stabilize tst_QWebEngineProfile::urlSchemeHandlersJoerg Bornemann2016-02-041-13/+21
| | | | | | | | Sometimes the emission of loadFinished wasn't caught. Use a QTRY_VERIFY-like function to synchronously load a page. Change-Id: Ib260a126c0cff7f254c97b1cd89f49b806010235 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Use fictional schemes in URL scheme handler testJoerg Bornemann2016-02-041-7/+7
| | | | | | | Avoid the usage of mailto. It might get forwarded to QDesktopServices. Change-Id: I2e8c889e8b0107b11c22c182a64685bc5ac16aae Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Preserve webchannel and userscripts when restoring historyAllan Sandfeld Jensen2016-01-311-0/+36
| | | | | | | | | | | Most page-state is set in webcontentsadapter::initialize except user scripts and webchannel. This patch ensures those are initialized too when changing to a new adapter during history restore. Change-Id: I4dca23ddab50480b1a72252a038834ce1802ad77 Task-number: QTBUG-50751 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: David Rosca <nowrep@gmail.com>
* Fix crash on exit for view-owned QWebEngineUrlSchemeHandler objectsJoerg Bornemann2016-01-281-0/+7
| | | | | | | | | | | | | | For view-owned URL scheme handlers the destructor would remove the handler and then trigger URLRequestContextGetterQt::generateStorage. This would access the browser context from the IO thread while it already has been destroyed on the browser thread. Increment the ref count for the browser context before every call of generateStorage, and decrement it when generateStorage is finished. Task-number: QTBUG-50160 Change-Id: Id8b1505891ec56e93bf9d47f33bb8bc3304eb55a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Fix deadlock on QWebEngineUrlRequestJob::failJoerg Bornemann2016-01-221-0/+23
| | | | | | | | | | | URLRequestCustomJob::notifyFailure calls NotifyStartError(status), which in turn will result in a call to URLRequestCustomJob::Kill. We must release the lock of m_mutex before calling NotifyStartError, otherwise m_mutex.lock() will wait forever in Kill. Change-Id: I319e45049766c2192dfc46a91b352b92ec677bc6 Task-number: QTBUG-50160 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Add autotest for URL scheme handlersJoerg Bornemann2016-01-191-0/+75
| | | | | Change-Id: I372366afce46703b9960ef2a8e5f575eaedb2514 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Stabilize tst_QWebEnginePage::symmetricUrl some moreJoerg Bornemann2016-01-111-1/+2
| | | | | | | | The second call to setUrl might override the first setUrl, depending on the timing. Change-Id: I30a8257751be3256a61668bd57195b1a12154d68 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Stabilize tst_QWebEnginePage::symmetricUrlJoerg Bornemann2016-01-081-1/+4
| | | | | | | | | | | | The sequence view.setUrl(dataUrl2); view.setUrl(dataUrl3); might result in a navigation entry for dataUrl2 or not, depending on whether the first call completes before the second call would overwrite the pending load. Change-Id: I487ada16517daa218078af007083a68c01697c9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Stabilize tst_QWebEnginePage::getUserMediaRequestJoerg Bornemann2015-12-101-3/+3
| | | | | | | Do not use 100 ms timeouts. Change-Id: Ied4a9a8b9af6ac33c025930a823d334000be2945 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* enable tests/auto/widgetsJoerg Bornemann2015-12-073-3/+12
| | | | | | | Enable autotests and blacklist tests that are known to fail. Change-Id: Iea23c69aa5a7bbd44c21803e352d17a92e9178a0 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* stabilize tst_qwebenginepage some moreJoerg Bornemann2015-12-071-6/+5
| | | | | | | | Remove a qWait, and use the default timeout of waitForSignal. Do not expect the CI to be as fast as your desktop machine. Change-Id: I30b060422a285a2110ee7e065a3f17f80039e775 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make QWebEngineFullScreenRequest const correctKai Koehne2015-11-121-1/+1
| | | | | | | | | | | | Let QWebEngineFullScreenRequest be logically const-correct. It feels weird to be allowed to call "accept()" or "reject()" on a constant object. Also allow the user to copy the request, but check whether the page is still valid in the implementations of accept(), reject(). Change-Id: Ibf139a126734fc8e2db68ec26dc8f24cd4438942 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* stabilize tst_QWebEngineScript::injectionPointJoerg Bornemann2015-11-121-4/+4
| | | | | | | | Use QTRY_COMPARE instead of a hard-coded timeout. Fix usage of setTimeout in DOMContentLoaded event listener. Change-Id: I915ea0d2c54cf45be42803963d03b19c15135fd4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix resetting attributes in top level WebEngineSettingsSzabolcs David2015-11-123-0/+66
| | | | | | | | | | | Store default values in separate containers and remove related FIXMEs from WebEngineSettings. Add API test case in order to demonstrate the bug. Change-Id: If9d98265cab0f41b543fe690d534879b65f2b577 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* add dummy positioning pluginJoerg Bornemann2015-11-065-0/+147
| | | | | | | | | | | The QtPositioning plugin loader only loads plugins that are marked as testable whenever it detects that a Qt autotest is running. We now provide our own very simple positioning plugin that always provides the same location: the western beacon of port entrance Warnemünde. Change-Id: I747188dc261ba47c10056ad50754bb686e75c783 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* remove "CONFIG += ordered" where applicableJoerg Bornemann2015-11-061-2/+0
| | | | | | | We will specify proper dependencies when they are needed. Change-Id: Ic62d891dcf3ee97fd98788e848c9ac7c69922282 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Print JS console messages by defaultKai Koehne2015-11-061-17/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the behavior of QWebEnginePage/WebEngineView to print JavaScript console.warn and console.error messages by default in a 'js' logging category. This matches also the behavior for QtQml, where console messages end up in a 'qml' logging category by default. So far access to the JavaScript console required either use of the remote debugging functionality, subclassing of QWebEnginePage, or implementing a custom handler. Anyhow, even then writing a seamless forwarding of the data and metadata to the Qt message handler is difficult. This patches implements this forwarding by default. The behavior can be changed by either setting up rules for the 'js' category, e.g. setFilterRules("js.*=false"); or by implementing onJavaScriptConsoleMessage(), or overriding QWebEnginePage::javaScriptConsoleMessage. [ChangeLog] Unhandled JS console messages are now forwarded to to the Qt message handler inside a 'js' category. Change-Id: I5480383a80dcf7a122496f9b7915264ef9036db3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-283-2/+82
|\ | | | | | | | | | | | | Conflicts: src/3rdparty Change-Id: I49acdd9b5ca94f2807b0c13a97f508a67f1c5750
| * Set off-the-record to true as documentedAllan Sandfeld Jensen2015-10-133-2/+82
| | | | | | | | | | | | | | | | | | | | The API had no way of setting off-the-record, because the constructor meant for it set it to false. The patch fixes the constructor and adds basic API tests for the QWebEngineProfiles. Change-Id: I407eb4a4b0524b6c4eb944d17d744620dd9db6fb Task-number: QTBUG-48724 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Remove userAgentApplicationName API test caseSzabolcs David2015-10-271-23/+0
| | | | | | | | | | | | | | | | | | | | We can't support this functionality, because we have multiple QCoreApplications in QtWebEngine and the user agent would pick up "QtWebEngineProcess" as value from the core layer. The users have to do it themselves. Change-Id: Id2b92d919ed47390f46b31da50a1e8e224c163ad Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Fix build of tst_qwebenginepageSzabolcs David2015-10-211-2/+8
| | | | | | | | | | Change-Id: Ic6cff6bed5ec1120ce8147ea02eeaea697788d16 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Fix ABI breakage due to fullscreen featureAllan Sandfeld Jensen2015-10-191-20/+5
| | | | | | | | | | | | | | | | | | | | | | We can not add a new virtual method without breaking ABI on some platforms, instead we need to use a setter. The API now uses a request object, and a separate signal for canceling, since canceling can not be rejected. Change-Id: If8069c343e86926293c30e8de179bf4e3cbd5886 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Remove whitespaces from custom HTTP user agentsSzabolcs David2015-09-291-20/+9
| | | | | | | | | | | | | | | | | | This prevents adding additional headers to the outgoing HTTP request through overridden user agent and unskips userAgentNewlineStripping API test. Change-Id: If9b3a88b0346058a7dc462471637d9777683fe82 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>
* | Unskip loadFinishedAfterNotFoundError test caseSzabolcs David2015-09-141-10/+6
| | | | | | | | | | Change-Id: Ie9f1aea1c7aad3e5a188667d1a38e5bc516564f8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Change some QNAM tests to use URLRequestInterceptorSzabolcs David2015-09-141-127/+0
| | | | | | | | | | Change-Id: I83536664df15375622e1b24496685ae19ab829c1 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Remove unnecessary QNetworkAccessManager test casesSzabolcs David2015-09-141-36/+0
| | | | | | | | | | Change-Id: I83b996740c96e8844f448cf4eb97593c6088a481 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Remove unnecessary QWebEngineFrame test casesSzabolcs David2015-09-111-193/+1
| | | | | | | | | | | | | | We will not implement API for web frames. Change-Id: I9ba09cc2f58fc8a2abc96f3148a76d854946fed4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge QWebEngineFrame tests into tst_qwebenginepageSzabolcs David2015-09-0911-1665/+1596
| | | | | | | | | | | | | | | | It also fixes the failing progressSignal test case and skips the asserting tests: setUrlToEmpty and setUrlHistory. Change-Id: I2b2b5504247c09e5791a3c202b24b83c266c286f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Enable geolocation permission testAllan Sandfeld Jensen2015-09-081-31/+28
| | | | | | | | | | | | | | Fix and enable the geolocation permission test. Change-Id: I337df66fe744101f47abb9381ef8151b697a35a2 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Fix selectAll on data urlAllan Sandfeld Jensen2015-09-031-3/+7
| | | | | | | | | | | | | | | | SelectAll only works when there is a focused frame, so we must ensure a frame is focused when the web-contents requests focus. Change-Id: I00d670321b29342fcd447b4b07251df776019f1c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | stabilize QWebEnginePage tests that use JS callbacksJoerg Bornemann2015-09-031-11/+87
| | | | | | | | | | | | | | | | Replace the QTest::qWait calls with a watcher object that can wait on JS callbacks. Change-Id: Iad5cfb73f31661103698fdb1c00e8a1e16f9981e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Enable parts of tst_QWebEnginePage::textSelectionAllan Sandfeld Jensen2015-09-011-6/+16
| | | | | | | | | | | | | | | | We can support the basics of the test though we are missing the actions to move selections. Change-Id: Iba1eae0d17857761145cd99c77a58a7d2f2b2c4c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | fix tst_QWebEnginePage::runJavaScript for "undefined"Joerg Bornemann2015-09-011-1/+1
| | | | | | | | | | Change-Id: Ic49f07ee1a1d0384eba33dd2090ebe2650600107 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | adjust W_QTEST_MAIN to changes in QTestLibJoerg Bornemann2015-09-011-0/+5
| | | | | | | | | | | | | | | | Needed for BLACKLIST support. Change-Id: I43f84a3150d0336b3f1702329f0c386545633f51 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | remove tst_qwebengineframe from the default buildJoerg Bornemann2015-09-011-1/+0
| | | | | | | | | | | | | | It's broken beyond repair and must be merged into tst_qwebenginepage. Change-Id: I16f3213cd63d7897eb2f95bac9c4fc1d41342fb3 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | fix automatic resource file inclusionJoerg Bornemann2015-08-261-1/+1
| | | | | | | | | | | | | | | | | | Commit c7334fbc broke the automatic resource file inclusion. qmake's exists function checks at the location of the .pri file, not the location of the .pro file. Change-Id: I54f1bc664c06c5675ef26341619142bc58f0831e Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* | Widgets: Add fullscreen supportSzabolcs David2015-08-263-1/+64
| | | | | | | | | | | | Change-Id: Ibf1697d2bb3b3af5e7d71149305c5acffba43f0f Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | move automatic resource inclusion to pri filesJoerg Bornemann2015-08-259-8/+2
|/ | | | | | | Avoid code duplication. Change-Id: Icd270ff4e45112111b7eb9590e415947f63ce15b Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Remove obsolete settings from widget tests.priAndras Becsi2015-06-301-8/+0
| | | | | | | This was inherited from QtWebKit and does not make sense any more. Change-Id: I6d7441a3b46fc10d045a281ac4a57527578821b5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Fix compile warnings of QWebEnginePage widget auto testPeter Varga2015-04-151-0/+5
| | | | | | | Change-Id: I22a63075c66d263e4aebb6aea47e80d6ce08cb3c Reviewed-by: Adam Kallai <kadam@inf.u-szeged.hu> Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Remove tst_setUrlWithFragment test caseSzabolcs David2015-04-091-41/+0
| | | | | | | | | This test is flaky, we don't have proper signals for in-page navigations and this case tests the behavior of the browser engine, not the QtWebEngine API. Change-Id: Ia94219df3501126bf1ab00a400a57d589b651589 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Fix openWindowDefaultSize QWebEnginePage testPierre Rossi2015-04-071-7/+8
| | | | | | | | | Add some qWait statements for timing-sensitive popup test. Replace QVERIFY with QCOMPARE for better reporting when it fails. Change-Id: I75eb2e774851beb01376042f0b60614db005970c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Enable build of QWebEngineScript API testSzabolcs David2015-04-072-24/+25
| | | | | | | The MSVC doesn't support this type of string literal concatenation. Change-Id: I051593a34c801df6c5264370ad751c45bbb41b5a Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* QWebEngineScript autotestPierre Rossi2015-03-182-0/+168
| | | | | Change-Id: Id29c1ed0b29114f426c35a45192a723d305c5b29 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Force c++11 support when building the testsAndras Becsi2015-03-121-0/+2
| | | | | | | | This fixes several warnings because of the use of the override keyword in private headers. Change-Id: Id30e13cab08be7b31a115e1b9b7334765d677cc3 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Fix tst_qwebengineaccessibility API testSzabolcs David2015-02-182-1/+21
| | | | | | | | | | | Implement a custom QTEST_MAIN preprocessor macro in order to support hardcoded Chromium content switches in the API tests. Force renderer accessibility to be on instead of enabling it on demand when a screen reader is detected. Change-Id: I9600ac4b26f4656104ce27ff19accbed4ea817c6 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>