aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Blacklist tst_QQuickListView::contentHeightWithDelayRemove on macos10.12Ulf Hermann2019-04-161-0/+3
| | | | | | Task-number: QTBUG-75202 Change-Id: I852439cd4d3b7106d018757e6c11c7d455fc9692 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Test whether the JIT is enabled on architectures/OSes as intendedMartin Storsjö2019-04-161-0/+22
| | | | | Change-Id: Ifdba6f08545e07b04cc7d9ace48ad0599c41229c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Allow fetchOrCreateTypeForUrl to report errors without qFatalErik Verbruggen2019-04-164-1/+6
| | | | | | | | Because qFatal will abort() the program. Task-number: QTBUG-71116 Change-Id: Ifd6be996cfbd6fff8e75ad2b26682c34f837ac88 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Check for (valid) compilation units while hashingErik Verbruggen2019-04-163-0/+6
| | | | | | | | | When an error occurred while creating a compilation unit, the pointer might be set to null. Subsequent use in hashing should check for this, and not use a nullptr. Change-Id: I62650917a740c9c1be29608285670153bed8703c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix string replacement with invalid capturesUlf Hermann2019-04-151-0/+28
| | | | | | | | | | | | If we have a theoretically valid capture reference that just didn't capture anything in this match, we don't want to treat it as literal. Only capture references that clearly are outside the range of things we can possibly capture with this expression should be treated as literal strings. Change-Id: Iab0bf329d11a6b9e172aa662f11751d86cfc26a6 Fixes: QTBUG-75121 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Quick fix for not working input handling for eglfsMichal Klocek2019-04-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On eglfs platform input events are driven by libinput and do not have window information as such. They are simply delivered based on QGuiApplication::topLevelAt window selection. In case of WebEnigne, QQuickWindow is returned as top level window. QQuickWidget uses this QQuickWindow as an offscreen window, however since 561b932 we fake 'visible' and 'visibility' values so windows api in qml can use those properties. This ends up with broken event delivery on eglfs, since window is offscreen and therefore not really visible. Make a minimalistic change to fix the issue, without braking QTBUG-49054, which requires 'visibility' to have fake values, and 'visible' will keep window as not visible for event delivery system. Fix encapsulation of setVisible(), prevent accidental window creation when setVsiible() called from qml via binding. The proper fix would require for example adding some new flag to underlying offscreen window, which could be used by event window selection mechanism or rework of qquickwidget offscreen window parameters expose to qml. Task-number: QTBUG-65761 Task-number: QTBUG-49054 Change-Id: I2a307ee5613771adf6d31f1c3cc4b4a25d7620df Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Don't create value types for QImage and QPixmapUlf Hermann2019-04-121-0/+23
| | | | | | | | Those are "scarce" resources which need to be kept as QVariant. Fixes: QTBUG-74751 Change-Id: I28381e2a754ed4bbf4e409dc275f6288b64416cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Extend blacklisting of qquickmultiponttoucharea to SLESTony Sarajärvi2019-04-111-0/+2
| | | | | | Task-number: QTBUG-59960 Change-Id: I6684b1a63425233dbee1d37acfe3e785cb76a597 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Detect and reject cyclic aliasesUlf Hermann2019-04-093-0/+7
| | | | | | | | Previously those would result in infinite recursion. Fixes: QTBUG-74867 Change-Id: I6c0043b43e72fe7bc3a2a139ca600af2d5bca5ad Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Avoid INT_MIN % -1 and INT_MIN / -1Ulf Hermann2019-04-081-0/+17
| | | | | | | | | Those throw arithmetic exceptions as the result doesn't fit into an integer. Fixes: QTBUG-75030 Change-Id: Ibd978848f42cf1c9da1e4af2dc9d7da123ef8f5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* If DragHandler is dragged within its margin, don't jumpShawn Rutledge2019-04-052-0/+69
| | | | | | | | | | | | | | | | | Not being pressed inside the target is a necessary but not sufficient reason to reset m_pressTargetPos to the center of the target. The intention was rather to make the target jump into position when the parent was a different item: e.g. if a Slider has a DragHandler whose target is the slider's knob, you can start dragging anywhere on the whole Slider but you want the knob to jump to the cursor position when the drag begins. While we're at it, both branches of the if in onGrabChanged() are checking that target() isn't null, so we can move that check out. Fixes: QTBUG-74966 Change-Id: I05be11d27422b070d941b9e43d4e1157e071c3a5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* In response to touch cancel, don't just ungrab, send an ungrab eventShawn Rutledge2019-04-042-0/+63
| | | | | | | | | | | | | | | | | | QQuickWindowPrivate::sendUngrabEvent() sends an UngrabMouse event, and that can be filtered by parent filters. If a touch cancel happens to a MouseArea in a ListView delegate, we need the ListView to filter the UngrabMouse event so that QQuickFlickable::childMouseEventFilter() will call QQuickFlickable::mouseUngrabEvent() and QQuickFlickablePrivate::cancelInteraction() will set pressed to false. The pressed state became true because Flickable filtered the press event; so for symmetry, it also needs to filter the touch cancel (in the form of a mouse ungrab), to avoid being stuck in a state where it can't move programmatically. Fixes: QTBUG-74679 Change-Id: I6c0ed364d2bc1f45c7e7b17846a09f6b53f91d0a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Allow enums in QQmlType to be set up in two separate passesUlf Hermann2019-03-285-0/+110
| | | | | | | | | | | The baseMetaObject and the property cache can become available at different points in time. If we have initialized the enums before either of them is available we want to add the additional enums when the other one appears. Fixes: QTBUG-74677 Change-Id: I57276681a50b6c04181c6a29e736f2dc20632a0c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Blacklist tst_qquickfolderlistmodel::nameFilters() on msvc2015/17Ulf Hermann2019-03-271-0/+3
| | | | | | Task-number: QTBUG-74739 Change-Id: Ib0f1d39cb5bc9864195b3c62d254fa38370faf0d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Re-use existing IC when freezing propertiesUlf Hermann2019-03-271-0/+13
| | | | | | | | | | | | | There is no reason to start from the empty class in that case. Furthermore, if the properties are already frozen, starting from the empty class will walk the IC hierarchy to the current IC. However, if the garbage collector has removed the intermediate classes in the mean time, we end up at a new IC which is equivalent but not the same. Therefore, the freezing never terminates. Task-number: QTBUG-74190 Change-Id: Id544bd00d3b4b563fb06dfce0edd0385e1d32a6c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Scope intermediate values when allocating objectsUlf Hermann2019-03-271-0/+13
| | | | | | | | | Otherwise the garbage collector might interfere and we might end up with dangling pointers in random places. Task-number: QTBUG-74190 Change-Id: I253c526ef930b8f0be14e96a42af8b66fda3b22d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix incorrect PathView.currentIndex assignment with StrictlyEnforceRangeShawn Rutledge2019-03-272-0/+88
| | | | | | | | | If currentIndex is quickly assigned a different index and then the previous current index again, it should not move. Fixes: QTBUG-74508 Change-Id: I8d610e3fe452c8631e082c648e77d2cb70ae57c5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Trigger the garbage collector when allocating InternalClass objectsUlf Hermann2019-03-261-20/+34
| | | | | | | | | | | | | | | | | As we check the icAllocator's slots on shouldRunGC() we should also check shouldRunGC() when adding slots. Otherwise we might never run the GC when only allocating InternalClasses. In addition, account for the "unmanaged" size of the PropertyAttributes that are part of the InternalClass objects. Those can be large. In cases where an excessive number of large InternalClass objects is created the garbage collector is now invoked frequently, which costs a significant number of CPU cycles, but prevents the memory usage from growing indefinitely. Task-number: QTBUG-58559 Change-Id: Icf102cb6100f6dba212b8bffe1c178897880eda0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix preview zoom problems on windowsTim Jenssen2019-03-221-6/+6
| | | | | | | | | | Apparently the window is moved to random places on multi-monitor setups on windows. Fixes: QDS-263 Change-Id: I21082c7031fefff3057074c147e82df7a88f4f78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Try to stabilize qquickrectangle testSimon Hausmann2019-03-221-4/+2
| | | | | | | | | Similar to commit 9921180a44d9097b1b83c2fa7b3f36dbb555140c, introduce liberal use of QTRY_VERIFY. Fixes: QTBUG-74605 Change-Id: I4552b1df4021f78cddff08f0b7d8629fafe25acb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update tests/auto/qml/ecmascripttests/test262Jani Heikkinen2019-03-221-0/+0
| | | | | | | | Task-number: QTBUG-73454 Task-number: QTBUG-71209 Change-Id: I12925ce49cc18f4bb6908a5515fc476b32a222dc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 896d49a4e1113e3eb4832b83920b0dfd76987259)
* Fix some memory leaksSimon Hausmann2019-03-211-9/+9
| | | | | | | | Use QScopedPointer where appropriate to avoid reporting false memory leaks with ASAN's leak checker. Change-Id: Ia3dfeafc66c2ad2ac8454861acce82b99678e517 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Initialize TranslationData padding before writing cache filesUlf Hermann2019-03-2118-36/+103
| | | | | | | | Otherwise the resulting files differ subtly. Fixes: QTBUG-74532 Change-Id: I12b4f1ba6dda781d63ad50cce87861ba24582bf7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Blacklist tst_QQuickMultiPointTouchArea::nonOverlapping for openSuseUlf Hermann2019-03-211-0/+2
| | | | | | | | The test is flaky, just like it is on Ubuntu. Task-number: QTBUG-74072 Change-Id: I65b1f7a00a72abd57460957a6399a86c213d082b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Blacklist tst_QQuickMultiPointTouchArea::nested on opensuseUlf Hermann2019-03-211-0/+2
| | | | | | Task-number: QTBUG-59960 Change-Id: I4a4d607c84600c83475d0ea5c10c9466d4dc626c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QUICK_TEST_MAIN_WITH_SETUP: fix qmlEngineAvailable() being called too lateMitch Curtis2019-03-214-0/+25
| | | | | | | | | | | | | | | | | | When I added the macro, I wasn't aware that TestCaseCollector was a thing. TestCaseCollector loads each QML file without running the tests (i.e. creates a QQmlComponent from the file without creating an object from that component). Since it still executes imports, the test can fail if types are registered or import paths added in qmlEngineAvailable(), since it's called too late. So, call it earlier. This should have no adverse effect on user code, as nothing of importance to the user will be skipped, and the documentation already details what can be expected by the time qmlEngineAvailable() is called. Change-Id: Ibd3a4b728bc87b90f89cc310fddf668c5879ad83 Fixes: QTBUG-74160 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* V4: Do not invert non-reflexive comparison binopsErik Verbruggen2019-03-211-0/+10
| | | | | | | | | This is only useful for the few (4) comparisons where we have specialized instructions, and it's very error-prone. Change-Id: I37efe94f54ba0adf393d9236df2d13aa6685eb46 Fixes: QTBUG-74476 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add test for dynamic anchors to parents in PropertyChangesUlf Hermann2019-03-203-0/+41
| | | | | | Fixes: QTBUG-71042 Change-Id: I4d0927b0d6c9a4ccaaddfbfd6dd2a7841fbbc845 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* V4: Don't mark InternalClass::parent when garbage collectingUlf Hermann2019-03-201-0/+26
| | | | | | | | | | The parent pointer is only kept so that we can update the parent's transitions when removing a child. There is no need to keep the parents alive for the children. Fixes: QTBUG-58559 Change-Id: Ia28183966bde6d478ca030fe11195489925dfc13 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement dummy QML lookups for "global" variablesSimon Hausmann2019-03-204-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When resolving names in the context of QML bindings, we now direct runtime access to QQmlContextWrapper::resolveQmlPropertyLookupGetter. At the moment this does basically the same as Runtime::method_loadName, which we called earlier. However this now provides the opportunity to optimize lookups in the QML context in a central place. When performing a call on a scope or context object property, we also did not use a CallName() instruction - which would have gotten the thisObject wrong - but instead we use a dedicated CallScopeObjectProperty and CallContextObjectProperty instruction. These rely on identifying these properties at compile time, which goes away with lookups (and also doesn't work when using ahead-of-time compilation). Therefore the qml context property lookup is using a getPropertyAndBase style signature and Runtime::method_callQmlContextPropertyLookup uses that. For the tests to pass, some error expectations need adjusting. In particular the compile-time detection of write attempts to id objects is now delayed to the run-time. The old code path is still there and will be removed separately in the next commit (as it is massive). Task-number: QTBUG-69898 Change-Id: Iad1ff93d3758c4db984a7c2d003beee21ed2275c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist tst_QQuickListView::enforceRange_withoutHighlight on opensuseUlf Hermann2019-03-201-0/+2
| | | | | | Task-number: QTBUG-74544 Change-Id: I0a8c54d2a02d959edacd82abcee4553222d575d9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Raise timeout in QQmlPreview testUlf Hermann2019-03-201-1/+1
| | | | | | | Apparently on some platforms this can time out. Change-Id: I30cd274ff3127319c558b473b6ec7e7f5bc79c38 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Blacklist AnimatedImage::test_crashRaceCondition_replyFinished()Ulf Hermann2019-03-201-0/+2
| | | | | | | | This is unstable on macOS 10.13. Task-number: QTBUG-74525 Change-Id: I8c04b4f0b4c560d1805982a605f994e0f1f1c87d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Blacklist tst_TouchMouse::buttonOnFlickable() on mingwUlf Hermann2019-03-201-0/+4
| | | | | | Task-number: QTBUG-74517 Change-Id: I3e0a90a264f8f686bba89e6b8dc4ebcf05418f77 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Relax tst_QQuickGridView::contentHeightWithDelayRemoveUlf Hermann2019-03-201-1/+1
| | | | | | | | | Apparently we cannot rely on the content height change to immediately take effect. Change-Id: I8b4bf7b7d0b72da84228c7a3f1460b42c97e0330 Fixes: QTBUG-74518 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Create import directory from intercepted URL, not orignial oneUlf Hermann2019-03-204-0/+42
| | | | | | | | | If the qmldir URL got intercepted, we should use the intercepted URL to get to the contents to be loaded. Fixes: QTBUG-73843 Change-Id: I51715575e767ed429a8237517f47196677409fe0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Baseline JIT: Save accumulator in toInt32LhsAcc()Ulf Hermann2019-03-191-0/+12
| | | | | | | | | | toInt32LhsAcc convertes both the lhs and the accumulator to int32. If the accumulator is not saved, a GC run during the conversion of the lhs might trash its value. Fixes: QTBUG-74058 Change-Id: Ic42693061c7d483bb430d77bcc095de6ff9a6843 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix compilation for SLES 12Ulf Hermann2019-03-181-1/+1
| | | | | | | | Apparently only some compilers see through QPointer on connect() Fixes: QTBUG-74500 Change-Id: I4d0ca7c8ab8b7eae281deff14523a1628e669279 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Try to fix tst_qquickrectangle::gradient_separate()Ulf Hermann2019-03-151-4/+2
| | | | | | | | | Use QTRY_VERIFY in order to allow for a delay in rendering the rectangle. Fixes: QTBUG-74468 Change-Id: I797b269358aaa35487144bb03a85f36646e2302f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Unify the JavaScript parsing recursion checksUlf Hermann2019-03-151-0/+5
| | | | | | | | | | | | | We only need to check in one central location and we can allow for more recursion. 4k recursions seem tolerable. A common default for stack sizes is 8MB. Each recursion step takes up to 1k stack space in debug mode. So, exhausting this would burn about half of the available stack size. We don't report the exact source location in this case as finding the source location may itself trigger a deep recursion. Fixes: QTBUG-74087 Change-Id: I43e6e20b322f6035c7136a6f381230ec285c30ae Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't keep raw pointers to SparseArrayNodeUlf Hermann2019-03-141-0/+22
| | | | | | | | | | | | The nodes are owned by the SparseArrayData and will be freed whenever an item is deleted from the array. Therefore, we have to look up the node for each iteration. This is slightly slower, but at least it doesn't crash. Fixes: QTBUG-74188 Change-Id: Id24324a8c83b00b3ad1212cdaabccabd6c8a999f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Disable tail calls for function called with more arguments than formalsUlf Hermann2019-03-041-0/+13
| | | | | | | | | | | We cannot easily find the required stack space to store the extra arguments without adding a new stack frame. In principle it would be possible, but heavily recursing on such functions should be a rare problem. Change-Id: I1a53a6d29e37ce67aa7bd64acb7b1f41197e84c0 Fixes: QTBUG-72807 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a bug where hover events were not sent if the mouse was never movedJan Arve Sæther2019-03-043-2/+42
| | | | | | | | | | | | | This happened if the "real mouse" was never moved, since moving the real mouse caused it to update the internal QQuickWindowPrivate::lastMousePosition. If the window never got any mouse events, it would therefore fail to generate proper hover events. However, if the window got exposed under a mouse cursor it would generate a hover enter event. We therefore update lastMousePosition when that happens also. Change-Id: I77d9b1bd779a813756c4056b015f2e81664b6d36 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Don't crash when passive grabber deleted before exclusive gr. releasedShawn Rutledge2019-02-262-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | In this scenario, a DragHandler is inside an Item in a Loader, under a MouseArea, which unloads the loader on press. So on press, the DragHandler acquires a passive grab, then the MouseArea acquires the exclusive grab, then the DragHandler is destroyed along with its parent when the Loader is unloaded. On release, QQuickEventPoint::setGrabberItem(nullptr) was sending an onGrabChanged(passiveGrabber, OverrideGrabPassive, this) notification. That was questionable: the handler was not just then getting its grab overridden, but rather un-overridden, because the exclusive grab was being released. It's also a good idea to check for null pointers, since m_passiveGrabbers is a collection of QPointers already, so we can tell when a passive grabber is deleted dynamically. It can also be reproduced with MultiPointTouchArea just as with MouseArea, so the test is written that way for convenience, because we have tst_multipointtoucharea_interop already. It doesn't really matter which handler has the passive grab, or which item has the exclusive grab that's being relinquished. Fixes: QTBUG-73819 Change-Id: Ic605efa2143a1d849be095dcb88d6c38d7d2ee19 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QAnimationGroupJob: Notify about removed children on clear()Ulf Hermann2019-02-261-2/+5
| | | | | | | | | | Derived classes, such as QSequentialAnimationGroupJob, might keep additional pointers to the children. Those need to be cleared, too. Therefore, use the regular removeAnimation() method for clearing. Fixes: QTBUG-73828 Change-Id: I64cc1fe4da59f10b29f27012b10f93b4289b6e5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlExtensionPlugin test: Don't fail when detecting old pluginUlf Hermann2019-02-261-1/+4
| | | | | | | | | | Some Qt modules still register plugins under the old IID. This makes the test fail if any of those have been compiled before. As the old IID is still recognized we don't really have to fail in this case. A warning should be enough. Change-Id: I409534d51c339ce361002866a50c47c721170b8b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Blacklist tst_QQuickShortcut shortcuts and multiple on opensuseUlf Hermann2019-02-261-0/+7
| | | | | | | | Those are flaky. They need to be fixed. Task-number: QTBUG-74050 Change-Id: I08f17aa490afc1809823fbda3bfdbbd9ee109087 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Unify and fix number to string conversion with radixUlf Hermann2019-02-251-0/+16
| | | | | | | | | | | Previously, the loop that generated the string could fail to terminate with certain numbers as input. Also, the algorithm was duplicated in two places. Change-Id: Ie2075148d931e7cfcedb5bcd23af61e2e8afc232 Fixes: QTBUG-73999 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* V4: Rotate loop in ArrayPattern and eliminate "done" labelErik Verbruggen2019-02-251-0/+9
| | | | | | | | | | This prevents jumping over the resetting of the unwind handler when an exception occurs. (cherry-picked from commit 0282b89ec672e25a465a8e51bc74c7fd58a624b1) Fixes: QTBUG-73985 Change-Id: I4a4da815f54c13980d239e0492f9b013991cfbd5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update the cursor when the window is enteredAndy Shaw2019-02-251-0/+79
| | | | | | | | | | | | When a window is entered, due to another window being hidden, then it is possible that the item under the mouse has a different cursor than the one previously set for that window. Since there will not be a mouse move at this point yet, then we should update the cursor right away. Change-Id: I2ef3c72617ae5c995a4daf7daef1ba3311fdcc12 Fixes: QTBUG-41045 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>