summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | Create WebContents with initially_hidden = trueJüri Valdmann2018-07-163-0/+20
| | | | | | | | | | | | | | Task-number: QTBUG-69360 Change-Id: Ia17ce79a8221aa339c72763a984bf1958935ef96 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add tst_loadsignalsMichal Klocek2018-07-0310-1/+340
| | | | | | | | | | | | | | | | | | | | Because of the recent problems with unexpected or missing loadStarted and loadFinished signals (which sometimes interfere with other load's signals), we add a set of auto-tests for load-signals. Done-By: Viktor Engelmann <viktor.engelmann@qt.io> Change-Id: Ia3b65c7b3c4d1ed44e94f409e047db6c6defb821 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Remove race condition workaround from downloadTwoLinksJüri Valdmann2018-06-281-20/+4
| | | | | | | | | | | | | | Not needed with Chromium 67 anymore. Change-Id: I3fd3557181b8140ca15762e8551611cc8c4baed4 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Test iframes over file scheme in tst_Origins::mixedSchemesJüri Valdmann2018-06-286-43/+64
| | | | | | | | | | | | | | | | Add previously missing combinations of schemes to the test. Task-number: QTBUG-62536 Change-Id: Idee99ba03ee17af056e57dd0b1ecbf1b6bc80dcd Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Stabilize tst_QWebEngineView::crashTestsAllan Sandfeld Jensen2018-06-271-1/+8
| | | | | | | | | | | | | | We keep getting progress 100 without any in between on some CIs Change-Id: Iaa3a9911b97ab5b5f642ee32668b9e081cd0fe51 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Allan Sandfeld Jensen2018-06-264-0/+45941
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devAllan Sandfeld Jensen2018-06-264-0/+45941
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf configure.json src/3rdparty tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp Change-Id: Id79ff6cf01c2db3a2044881ddcbf044abdf84936
| | * Add binary compatibility files for 5.11 for QtWebEngineMilla Pohjanheimo2018-06-063-0/+45931
| | | | | | | | | | | | | | | | | | | | | Files for bic test added. Change-Id: I1ae9f54d70a9891248ad9d65efbf9ec29f022452 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * Fix segfault in QWebEnginePage::triggerActionJüri Valdmann2018-05-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Calling triggerAction for a context-menu-specific action (like DownloadLinkToDisk), when no context menu exists, will crash. Change-Id: Ife647b7a7d8ab1a0d9dcb7d3566be130516e6e63 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| | * Apply settings on pending RVH tooPeter Varga2018-05-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an improvement of: bab4abab Keep settings synchronized when RVH swaps Updating settings during RVH swap is flaky because it happens after the load start of RenderFrame thus it is not guaranteed the ViewMsg_UpdateWebPreferences message is received by the render process before the load finishes. This means that the setting might not be applied on the current page if it was set during the navigation. The new RVH is created at the very beginning of the navigation, so access it via the pending or speculative main frame of the page thereby make it possible to update its settings before the load of RenderFrame starts. Task-number: QTBUG-66656 Task-number: QTBUG-68424 Change-Id: I4fbba597579551bb3329936ccd7b357cf8daa4ea Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| | * Blacklist tst_QWebEngineSettings::setInAcceptNavigationRequestPeter Varga2018-05-241-0/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-68424 Change-Id: Idb72162b8aaa92a619fb7baf578f63e3d0171470 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | | Stabilize IME auto testsPeter Varga2018-06-261-0/+5
|/ / | | | | | | | | | | | | | | | | | | Set focus on navigation if testing IME composition in an input field. Otherwise, RenderWidget::ShouldHandleImeEvents() may ignore the event. Related fails occurred after 67-based update on macOS. Change-Id: I9e048a52dcc14a4bd99fe00c4a42cd3f8330c8f4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 67Allan Sandfeld Jensen2018-06-2611-21/+28
| | | | | | | | | | Change-Id: I13cedba56012f74651a044d6fa8f0957487bf3eb Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Adaptations for Chromium 66Allan Sandfeld Jensen2018-06-262-9/+9
| | | | | | | | | | Change-Id: Iee88721a50036d4ef85a23dd1708d4fb84218708 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Make tests work on high-dpi screensKai Koehne2018-06-253-7/+9
| | | | | | | | | | | | Change-Id: I89c39ccf6fd383cad33639959a90b7592467edac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Fine tune configure and clean up header includesMichal Klocek2018-06-1212-30/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously configure was generating two config headers qtwebengine-config.h and qtwebengine-config_p.h, however those headers were never installed or included as dependency in Makefiles. Moreover, due to the name clash all features were included into qt_lib_webengine_*.pri which is QtWebEngine QML module. Move configure to core so all features belong now to qt_lib_webenginecore*.pri. Fix global includes to include qtwebenginecore-config*.h. Drop all DEFINES and use QT_CONFIG instead. Cleanup all evil looking includes in headers for webengine and webenginewidgets. Change-Id: Iddbc8bf4487d9a5f0c19a71a9569535083507756 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Use range-based for instead of Q_FOREACHJüri Valdmann2018-06-064-23/+29
| | | | | | | | | | Change-Id: Ibf016b795ff98fddfa29fb5dc63924a2d2159d71 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Don't try to run user scripts if provisional load failedJüri Valdmann2018-06-053-0/+27
| | | | | | | | | | | | | | | | | | Fixes DCHECK in UserResourceController::DidFinishDocumentLoad. Task-number: QTBUG-68594 Change-Id: I67128e2144420e61f8bffe080fa16a828b8202ad Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | RWHVQDW: Remove QGuiApplication::sync() callJüri Valdmann2018-06-041-51/+46
| | | | | | | | | | | | | | | | It is a workaround that is no longer needed. Task-number: QTBUG-64501 Change-Id: I51b7ad0a24cf80ee0c90be0c8c463ceeeee4239e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add dialog unit testMichal Klocek2018-05-3010-1/+628
| | | | | | | | | | | | | | | | Add test to see if correct dialogs are requested Change-Id: I10a7d384b5704fd337b42ea788b6ec6411828d87 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Test runJavaScript without JavascriptEnabledJüri Valdmann2018-05-181-0/+16
|/ | | | | Change-Id: I5fef99d3674fe4dee43df79d740988853d144abd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Remove qwebchannel.js from test and exampleMichal Klocek2018-05-175-418/+3
| | | | | | | | Use qwebchannel.js shipped with qtwebchannel. Change-Id: Iceead5131d22a6988bbb4e7a3cca1e9f21908e3e Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Keep settings synchronized when RVH swapsPeter Varga2018-05-171-0/+35
| | | | | | | | | | | There can be more than one RenderViewHost assigned to a single WebContents. This is the case when starting a page load results changing processes. When applying settings during the load it updates only the old RVH. This fix applies the settings to the new RVH too after the swap. Task-number: QTBUG-66656 Change-Id: I833415b2a34f58e2a9a18c209a025c82b73aa65a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace invalid characters in WebChannel messagesJüri Valdmann2018-05-163-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out JavaScript's JSON.stringify is not guaranteed to produce valid UTF-16 strings. It is possible in JavaScript to produce string objects which contain invalid code units (unmatched surrogate pairs) and JSON.stringify will simply copy this data to it's output. However, such a string cannot be losslessly converted to UTF-8 and this leads to fun errors in WebChannelIPCTransport. This patch - Adds a test for the scenario above. - Changes WebChannelIPCTransport to replace these invalid code units with the Unicode replacement character U+FFFD. - Changes WebChannelIPCTransportHost to validate the data it gets from the renderer. Not validating the data defeats the whole point of Chromium's fancy multi-process architecture: the renderer is not to be trusted. - Changes WebChannelIPCTransport to throw JavaScript exceptions for various errors (missing argument, wrong type, invalid JSON). Seems like the polite thing to do. Task-number: QTBUG-61969 Change-Id: I83275a0eaed77109dc458b80e27217108dde9f7b Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix tst_QWebEnginePage::openLinkInDifferentProfileJüri Valdmann2018-05-151-0/+1
| | | | | Change-Id: I9468faccfc8d943302bb643a57b9f7d1eed8862a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.11.0' into 5.11Qt Forward Merge Bot2018-05-091-0/+28
|\ | | | | | | Change-Id: Id41b0b07a934994471df40de884e1231ee1c0e8e
| * Fix invalid site instance when switching browser contextsJüri Valdmann2018-04-301-0/+28
| | | | | | | | | | | | | | | | | | All pages in a site instance should belong to the same browser context, an invariant which is violated by our WebContentsDelegateQt::OpenURLFromTab. Task-number: QTBUG-67900 Change-Id: I754180bb96de07448ee3058210391f7856f4caeb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Remove hardcoded size from QWebEngineView::sizeHint()Szabolcs David2018-05-093-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | 800x600 takes more space than expected when building a layout which contains QWebEngineView. Now this function does exactly the same as QWidget::sizeHint(). Add an auto test and update examples which were depending on this hardcoded size. Change-Id: I3b34b7d37cc99a8d6a49100d6c4b66b5b6a1c999 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Update tests for "Don't create undeserializable mojo origins"Jüri Valdmann2018-05-022-9/+14
| | | | | | | | | | | | | | | | Check that the workaround in src/3rdparty bf10f2f32a behaves as expected. Task-number: QTBUG-62536 Change-Id: Ieae4ad61df303aae5c65d4f7be487574ce32eae0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add tests of Web Workers over local and custom schemesJüri Valdmann2018-05-028-0/+129
| | | | | | | | | | | | | | | | | | Shared workers work, service workers don't. Dedicated workers over custom schemes trigger the same serialization error as WebSockets. Task-number: QTBUG-62536 Change-Id: I97b4b8c267f6cfca74bc0abfcca905b0adeabe3d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix handling of bad @match directivesSzabolcs David2018-04-272-0/+26
| | | | | | | | | | | | | | | | | | User scripts with parse errors in their @match patterns were included on all pages. Don't allow to fallback to "@include *" in this case. Task-number: QTBUG-67726 Change-Id: I8172184e79fe3e515f391bc6cc8274a624e67a19 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix finishing IME compositionPeter Varga2018-04-261-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | Call RenderWidgetHostImpl::ImeCommitText() instead of RenderWidgetHostImpl::ImeFinishComposingText() to trigger the necessary JavaScript events on composing. This fixes IME composition (eg. for dead keys) on web pages which use custom JavaScript IME handler like facebook. Task-number: QTBUG-66046 Change-Id: Ibc177995ba6e85eca42ae333decacfe6e788ce41 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Test of data-url with anchor and base URLAllan Sandfeld Jensen2018-04-201-0/+16
|/ | | | | Change-Id: Ib63727794a794c20b1ca372ab6457c2a8a141762 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Add tests/auto/widgets/originsJüri Valdmann2018-04-1711-2/+377
| | | | | | | | | | Unlike http/https, the same-origin policy for file, qrc and custom schemes is not specified in any standard and, for the latter two, is not tested by Chromium either. Therefore some tests might be useful. Task-number: QTBUG-62536 Change-Id: I194d06c16c44b0a78bf4dba57415a2d2c6b991cc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add tst_QWebEnginePage::devToolsJüri Valdmann2018-04-171-0/+43
| | | | | | | Open devtools from autotest. Change-Id: I5e78d6259fdd29df5608b45292ee0a786d179e26 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Shorten names of permission classesJüri Valdmann2018-04-132-22/+22
| | | | | | | | | | | Remove 'permission' from class and signal names, so e.g. QWebEngineQuotaPermissionRequest becomes QWebEngineQuotaRequest and quotaPermissionRequested becomes quotaRequested. Rename the internal controller classes to public name + "Controller". Change-Id: I247714ab0a2880adbf4ed8ee68f1b78838ae7a14 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix test failure in test_contextMenuAllan Sandfeld Jensen2018-04-101-0/+2
| | | | | | | | Seems making a context menu too early is racy. Change-Id: I9cf268d506e6fcee348102cc3138c475ac94d55c Reviewed-by: Valentin Fokin <fokinv@inf.u-szeged.hu> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Fix building with Qt 5.9Allan Sandfeld Jensen2018-04-071-2/+2
| | | | | | | | Avoid hitting undefined reference to 'bool TestNamespace::QTest::qCompare<unsigned long, unsigned int>...' Change-Id: I91588869708899e1055619ca9ba46d2061869417 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Avoid creating temporary blank WebContentsJüri Valdmann2018-04-062-2/+3
| | | | | | | | | | | | | | | | | | | | | - Avoid creating a blank WebContents for new QWebEnginePages only to replace it with a different blank WebContents moments later. This problem is already solved in QQuickWebEngineView by lazy initialization, therefore the patch moves this lazy initialization into WebContentsAdapter itself so that it can be applied to both QQuickWebEngineView and QWebEnginePage. - Try to delay WebContents creation until the first navigation so that we have enough information available to pick the right initial SiteInstance when calling WebContents::Create. This is done by triggering WebContents creation from the first call to a WebContentsAdapter::load* method. - Use the SiteInstance from WebContentsDelegate::OpenURLFromTab. This method gets a SiteInstance pointer which we should give to WebContents::Create. Task-number: QTBUG-65561 Task-number: QTBUG-67163 Change-Id: Id7b351998adefb810cf27c61a1447b61d7f4c606 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use cookie-access rights for webcontent settingsAllan Sandfeld Jensen2018-04-051-0/+26
| | | | | | | | | | This ties the indexed-db, DOM storage and filesystem access to cookie rights as they can all do the same cookies. A previous patch did the same for workers, but we were missing this class to complete the logic. Change-Id: I5ea894b6c631bcf25439759174866d260b91b71a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Update tst_QWebEngineAccessibility::roles() auto test for Chromium 65Peter Varga2018-04-051-11/+6
| | | | | Change-Id: Ibca5362c9d1e388885132259fa95a9f575f45fc8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* 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>