summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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>
* 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