aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QQuickTableView: don't rebuild table upon querying content sizeRichard Moe Gustavsen2018-09-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | Overriding contentWidth/Height was done to be able to force build the table early if the app needed to know the size of the table already at Component.onCompleted (to e.g center the viewport on the center of the table). But now that we have a forceLayout() function, it's better to require that that function should be called before querying contentWidth/Height at this stage. By not building the table on the fly, we allow the application to bind expressions directly to contentWidth/Height, without being concerned about potential binding loops that can occur as a result of us rebuilding the whole table behind his back. The benefit of this overshadows the need to call forceLayout() explicit for some corner cases. Note that we still redefine the contentWidth/Height properties in TableView so that we can catch if the application sets an explicit contentWidth/Height (which is tested by checkExplicitContentWidthAndHeight()). Change-Id: Ic4499b3939af1cb3a543e4c006023d0d6f12fd3b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Qml Preview: Record more detailed frame statisticsUlf Hermann2018-09-101-7/+17
| | | | | | | | | | | | | Just the number of frames per second doesn't tell us the reason for any low frame rates. The problem could either be GPU-bound, and rendering could take very long, or the problem could be CPU-bound, with synchronizing or the gap between frames being very long. Reporting the rendering and synchronization times in more detail gives the client an idea of what is actually going on. Change-Id: Ib2840a9e1aa9b9738e967730c668769946659be2 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Bump tests262 submodule to include .gitattributes fixJani Heikkinen2018-09-101-0/+0
| | | | | | Task-number: QTBUG-70450 Change-Id: Iece912a4184f28290d7a40f3d83253efd81559d2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: don't set contentX/Y to zero when building the tableRichard Moe Gustavsen2018-09-102-0/+91
| | | | | | | | | | | | Don't reset the content item to 0,0 when we do a rebuild of the table, since that will overwrite whatever the user has set to contentX/Y explicitly. Doing the latter can be handy if he needs to flick the table to a start position upon construction. If the user want's to move the content item back to origin when changing the model, he can instead do so manually. Change-Id: Ic7bc424312569e49115dea5037dd1109261a3aff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: don't override margins API in TableViewRichard Moe Gustavsen2018-09-101-99/+19
| | | | | | | | | | | | | | | | | | | | | | Flickable has a margins API with the exact same naming as the margins API in TableView. This means that overriding those properties in TableView was an oversight, and a mistake. This patch will therefore remove the margins API from TableView. However, since the API already exists is in Flickable, the resulting API remains unchanged. But it will ease the TableView implementation a bit, since we can then remove code that takes margins into account (since Flickable does this automatically for us). The only real difference that will take effect from this change, is that any overlay or underlay items inside the flickable will need to have negative coordinates if you want to position them on top of the margins (e.g to create a header on top of the table). Change-Id: I43af66e49f5ddff90739a1c789aacb77ed18b4ce Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Implement OwnPropertyKeys for TypedArrayLars Knoll2018-09-101-6/+0
| | | | | Change-Id: I85d6cfa4b4652863cfafad4810176d99dccdabc9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a small bug in virtualHasPropertyLars Knoll2018-09-091-1/+0
| | | | | | | | | It should call hasProperty() on the proto if the property wasn't found locally, instead of looping and calling getOwnProperty, as this leads to subtly differences with Proxy objects. Change-Id: I088b0522c621999b7991f9194f46eaa9f6e15206 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Include symbols in getOwnPropertyKeysLars Knoll2018-09-091-2/+0
| | | | | | | And fix getOwnPropertySymbols and getOwnPropertyDescriptors. Change-Id: Ie0e4c3d308ffe8a904e9a6ab9242b2cda59d779f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Proxy.revokable creates an object with an anonymous revoke functionLars Knoll2018-09-091-1/+0
| | | | | Change-Id: Iaed36da1284e6545a88eaa17d23fa2862fc611be Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix ownKey iteration over Proxy objectsLars Knoll2018-09-091-4/+0
| | | | | Change-Id: I045a4844c06df9232cc8b04485ab0a39bb990e3f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix some bugs in Proxy::virtualGetOwnPropertyLars Knoll2018-09-081-3/+0
| | | | | Change-Id: I28c32f2bfdac8848baf82905fb04790f29451805 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix spec compliance of Object::virtualGet()Lars Knoll2018-09-081-1/+0
| | | | | Change-Id: I9c07a6b08e9029b893c28e7a945f839c0f0dda8d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Skip all realm related testsLars Knoll2018-09-082-105/+14
| | | | | | | | We don't support realms currently, and it's unclear whether we'll ever need the support. Change-Id: I023f84d477f374b3cef2590a78542c0c9408a144 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement IsCompatiblePropertyDescriptor and use it in ProxyLars Knoll2018-09-081-3/+0
| | | | | Change-Id: I40bc5ce2858ebfe1afb04a7957a53114b37ef50f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix toNumber conversions for hex, octal and binary stringsLars Knoll2018-09-081-3/+0
| | | | | Change-Id: Ifb7159a3307c96b27530e001ab13bcd6ddd03d09 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix test failures in NumberLars Knoll2018-09-081-9/+0
| | | | | Change-Id: I0743e9d7fdda0be7a8bb4f9fe3b8e195722c1c90 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a corner case in Math.max()Lars Knoll2018-09-071-1/+0
| | | | | Change-Id: I9dffaec95b01757fb21466617d055def2edeeb30 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix Date.Utc()Lars Knoll2018-09-071-6/+0
| | | | | Change-Id: Iefba82adbf8f7b944079d165054e9dfe4461ac77 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: remove focus for the delegate item itself, not only for the ↵Richard Moe Gustavsen2018-09-072-11/+25
| | | | | | | | | | | | child "isAncestorOf" will not include itself as an ancestor. So we need to check if the delegate item has focus as well, since we also want to remove focus for that case. This can e.g happen if the delegate is a TextInput directly. Change-Id: I5a5f5a7ec262eacdac64d72b0f41bca991dbab73 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Don't evaluate the switch expression inside the switch blockLars Knoll2018-09-071-2/+0
| | | | | Change-Id: I6cbe0610b65c9f9d7381bc1c70ae17e10486d5c3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a smaller bug in IteratorCloseLars Knoll2018-09-071-1/+0
| | | | | | | Throw the correct error in all cases Change-Id: Ic8f146cf13db605cb54cb8c96aaf0b3a1b9cca96 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for yield*Lars Knoll2018-09-071-45/+0
| | | | | Change-Id: I5b054b59519ed825459a5b0b0a7cd2c6fc8a3797 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Throw a type error when trying to destructure null or undefinedLars Knoll2018-09-071-4/+0
| | | | | Change-Id: Id1bba1a729124bccb8a90dcf40252fe5c69d27a3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix exception handling while destructuringLars Knoll2018-09-071-12/+0
| | | | | | | | | | | | | | | When an exception happens during destructuring, IteratorClose needs to be called, unless the exception happened inside the IteratorNext call (in that case the iterator is assumed to be invalid and we shouldn't call close on it). Implement this, by ensuring that we set the done return variable of IteratorNext to true whenever IteratorNext throws an exception. IteratorClose will check the done state and not do anything in that case. Change-Id: I73a27f855f2c4d3134b8cc8980e64bf797d03886 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Some fixes when unwinding inside for-of loopsLars Knoll2018-09-071-8/+2
| | | | | | | | This is not perfect yet, as the two regressions in TestExpectations show, but it's an improvement over the current situation. Change-Id: I82c0ef0f69619562037c573bea1026abc53c1ab3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix new.target access from eval()Lars Knoll2018-09-071-3/+0
| | | | | Change-Id: I1855eb303225d1784b019f8eebab0ad8bf2cdf5e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: clear focus when delegate item with focus is flicked outRichard Moe Gustavsen2018-09-062-0/+108
| | | | | | | | | If we flick out a cell that has keyboard focus, we should clear that focus. Otherwise, the item will be focused also when it is later reused. Change-Id: I0fb79b6d906c1907a352de4ec52e3b488064b55a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQmlTableInstanceModel: don't fall back to use DelegateChooser as delegateRichard Moe Gustavsen2018-09-062-0/+76
| | | | | | | | | | | If the application uses a DelegateChooser, but the chooser fails to resolve a delegate for a certain index, it should not use itself as the delegate instead. This will cause the application to crash. Instead, we just print a warning, and return nullptr, which will let TableView handle the situation gracefully. Change-Id: Ibaf9da09fd11149362f5b674fc61db47593de10c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: add anchor check for delegateRichard Moe Gustavsen2018-09-062-0/+78
| | | | | | | | | If a delegate is using anchors, TableView will not be able to layout the item. So issue a warning if that is the case. Change-Id: I358d981067c23fdab2fc486003afc8bd685f940d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* tst_qquicktableview: reuse the same QQuickView for all test casesRichard Moe Gustavsen2018-09-061-2/+11
| | | | | | | | | | | | Instead of creating a new view for every test (which will open a new window), it's better to reuse the same view. Especially since there is a bug in AppKit (which has been reported by Tor-Arne, but I could not find the rdar id) that can sometimes be hit when closing a window, causing it to crash. So creating and closing almost 100 windows in this test will sometimes trigger that bug. Change-Id: If4d962e4b9aeea154d4cd764a5bc414bcd2995b7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlDelegateModel: don't fall back to use DelegateChooser as delegateRichard Moe Gustavsen2018-09-062-0/+74
| | | | | | | | | | | If the application uses a DelegateChooser, but the chooser fails to resolve a delegate for a certain index, it should not use itself as the delegate instead. This will cause the application to crash. Instead, return nullptr (like we do in the function guard), which will let the item views handle the situation gracefully. Change-Id: I9b3b4aa2626d1f8521b4395096300ac12150c63f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* fix accesses to this in arrow functionsLars Knoll2018-09-051-4/+0
| | | | | Change-Id: I4c0cfc3a120fc0b246760886b576e92d3f7623ff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix logic error in JSCodeGen::fallbackNameLookup()Lars Knoll2018-09-051-1/+1
| | | | | | | | | | Don't return a name reference if we fail to lookup something in the scope object, but rather continue trying in the context object. Task-number: QTBUG-70315 Change-Id: I73f8aa7b648320434ef0ef37a4c12dca1eb7b209 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a couple of internals in TypedArraysLars Knoll2018-09-041-15/+0
| | | | | | | | Handle property keys that are numeric strings, and implement getOwnProperty. Change-Id: I4c7ed21b6429b07f02a28bce537bcb7934a993d3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement defineOwnProperty for TypedArraysLars Knoll2018-09-041-9/+0
| | | | | Change-Id: I2e7aa05a340d54e2f34ec4e59a69f3ce66be75d9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix subclassing of ArrayBuffer and TypedArraysLars Knoll2018-09-041-8/+0
| | | | | Change-Id: I481974c224f7fdb4df6b641e8dd550add96b4c08 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Throw a reference error if the super constructor is not calledLars Knoll2018-09-041-24/+0
| | | | | | | And return the correct this object from the subclass constructor. Change-Id: I8d68f07c3080f8c5ff8b10ad2cc85e017bf710d8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Arrow and generator functions don't have a prototype propertyLars Knoll2018-09-041-1/+0
| | | | | Change-Id: Icbc25f1f723fe45a8c265f1b4bdf5f3fad3c4775 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Member functions should not have a prototype propertyLars Knoll2018-09-041-6/+0
| | | | | Change-Id: I19eb4012c8fee51a7e5bf264d11ab5337ac2a88d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Don't define a prototype property for most functionsLars Knoll2018-09-041-16/+0
| | | | | | | | Only functions that are constructors should have a prototype property. Change-Id: Ifcf6f8b6c38de055d871d57ada38a23432974263 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Always generate a context if an inner function uses superLars Knoll2018-09-041-6/+0
| | | | | Change-Id: I4215c215a28da6855d946dec8727c0c4f0acb933 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix accessing of arguments inside eval and arrow functionsLars Knoll2018-09-041-1/+0
| | | | | Change-Id: I1df6389a1fa6f1c3fc257df3075cea0c0af6a9cf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: allow negative marginsRichard Moe Gustavsen2018-09-031-17/+31
| | | | | | | | | | | Currently TableView will hang when using negative margins. This patch will fix this so that negative margins will work as expected. An alternative implementations would be to only allow positive margins, but from an implementation point of view, there is really no reason to add such a restriction. Change-Id: Iea89212eb9d7f9d467955e27c70d9b7583a80d2e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Rename QQEventPoint::GrabState to GrabTransitionShawn Rutledge2018-08-312-15/+15
| | | | | | | | | | | | | | | | | | | This enum represents a transient state transition, and only sometimes corresponds to the current grab state of an event point. For example after exclusive grab has been canceled, the current state is that there is no exclusive grab: it doesn't make sense to remember that the way it got there was by cancellation. There was an idea to add a grabState property, but not all values would be eligible. An EventPoint can be exclusively grabbed by one item or handler at a time, and by multiple passive grabbers at the same time, so even a Q_FLAG would not fully express all possible states. Besides, there is already an exclusiveGrabber property, and we could add a passiveGrabbers list property if we had a real need. So adding a grabState property seems unlikely, and therefore is not a good enough reason to keep this enum named as GrabState. Change-Id: Ie37742b4bd431a7e51910d79a7223fba9a6bd848 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Throw type error if this is uninitialized when accessing superLars Knoll2018-08-311-2/+0
| | | | | Change-Id: I028e198d46a2ec1c55f5dd4cce8dd868ed3e8202 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix thisObject when calling super propertiesLars Knoll2018-08-311-4/+0
| | | | | Change-Id: Ia520d43ea2c29c16cfc8ffc86a32187a78848502 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix super property accessLars Knoll2018-08-311-1/+0
| | | | | | | | | Super properties work in a rather special way by accessing a 'home object' on the function object, and reading from it's prototype. Change-Id: I666334c9c27048c6c2ba6770dd8c9f56aecbee14 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix internalPutLars Knoll2018-08-311-14/+1
| | | | | | | Fix spec compliancy of the put() method. Change-Id: Iab4f4040cc7308d0c8d9f2eed239af98b7c2eee2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use PointHandler for singlePointProperties manual testShawn Rutledge2018-08-301-24/+25
| | | | | | | | The name indicates that it should test a SinglePointHandler, which DragHandler no longer is. Change-Id: I3c585b43c1334cf6794a98c92f742f92243adac8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* MultiPointTouchArea: capture the mouse position on pressShawn Rutledge2018-08-302-0/+62
| | | | | | | | | | | | | | | | | | | | | QTouchEvent::TouchPoint already remembers the start position from where the touch point was pressed. But when MPTA handles mouse events, it populates a synthetic touchpoint (the _mouseQpaTouchPoint variable). So to be fully consistent, it needs to store the mouse press position there too. Since this was not done, gestureStarted was emitted for almost any mouse movement (while pressed) because the stored startPos was 0,0, so MPTA would nearly always think the drag threshold had already been exceeded. In a QML onGestureStarted callback gesture.touchPoints[0].startX and startY were always zero too. Amends fe2de633f9b9454ec8a9c2a5874ad85f49d8d54d Fixes: QTBUG-70258 Change-Id: I5bc0abbe0cb52c1aa02d60a76c52ec26bb0683e6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>