aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QQuickItemView: Don't change the viewport while in layoutUlf Hermann2018-09-272-0/+104
| | | | | | | | | Moving the viewport in the middle of a layout operation is a bad idea as it causes the visible items to change. Task-number: QTBUG-49224 Change-Id: I45a214560e00b65ed53b9385e7a539bb4304b7d9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QML: Demote incubation problems to info levelUlf Hermann2018-09-271-1/+1
| | | | | | | | | | | | | | | If the context or object in question gets destroyed during incubation, that is not a major problem. We just clean up the mess and continue. Especially, failure to create a delegate for an item view is not fatal. This routinely happens if the whole view has been dropped between object creation and incubation. Since 0412de08fd65c5fef9d010a68b40a256f521ef61 info and warning levels are properly separated. Task-number: QTBUG-49224 Change-Id: Ie59dfca8edf91b80dcf33e742766863feba9c8fa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Manual test, TableView, abstracttablemodel: add more logic to the testRichard Moe Gustavsen2018-09-274-18/+238
| | | | | | | Add buttons for adding and removing rows and columns Change-Id: I8d391db4f61ff4ec4273adc7134bd30ffc73fa3c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Limit the repeater model size for integer modelsErik Verbruggen2018-09-241-0/+6
| | | | | | | | | Otherwise you might be able to put INT_MAX in, which would cause problems with things like memory allocations. Task-number: QTBUG-54752 Change-Id: I758d04af65049181c0c741ff42e92a6450963201 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix test262 submodule sha1Simon Hausmann2018-09-241-0/+0
| | | | | | | | Commit e436fb3569603bca8ad0a71fef67c03d2920aedc accidentally reverted Jani's fix in commit bf07bdcdf97473f1239ff965c7de795ec6caca42. Change-Id: Ie1b5fff4944ea0918f85b28b2dca51c419f24f5d Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* qmlplugindump: Make manual test work with shadow buildsKai Koehne2018-09-242-6/+7
| | | | | Change-Id: Ifaf87ba32f0c864ea264e78fba1ffc3d12c88a13 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix use of lexically scoped variables in modulesSimon Hausmann2018-09-233-1/+19
| | | | | | | | | | | | Their use may trigger setting c->requiresExecutionContext on the module context, which is correct. However, unlike functions, modules at instantiation time always have their context created ahead of time (to populate imports). Therefore we must not emit call context creating byte code instructions where we'd end up storing exports in the wrong place. Change-Id: Id1264f1cfa6a7f1cd94247ffe71938bc9c5c3ff9 Fixes: QTBUG-70632 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Better inheritance structure for functionsLars Knoll2018-09-231-2/+0
| | | | | | | | Give Arrow functions their own representation. This also prepares for further optimizations especially for the instanceof operator. Change-Id: I1f70c0271169a237e1acdeb7fe855be957ba2ea5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix tst_qmldiskcache::cacheResources() and cacheModuleScripts() on WindowsFriedemann Kleint2018-09-201-22/+30
| | | | | | | | | Rewrite the tests to not try to delete the cache, but operate on sets of newly created files. Task-number: QTBUG-70609 Change-Id: I63135794e2c52048da12977e5c40c0bcce5a24b1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQuickTableView: build the table when the component is finalizedRichard Moe Gustavsen2018-09-173-4/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | componentComplete() is called on us after all static values have been assigned, but before bindings to any ancestors have been evaluated. Especially this means that if our size is bound to the parents size, it will not be ready at that point. Since we cannot build the table without knowing our own size, we waited for the updatePolish() call before we started to build the table. The problem with that strategy, is that any asynchronous loaders that TableView might be inside would already be finished by the time we received the updatePolish() call. The result would be that we ended up loading all the delegate items synchronously instead of asynchronously. (As soon as a loader has finished loading the initial item, async loading will no longer be used). This patch will therefore add a componentFinalized function that gets called after all bindings have been evaluated, but before the loader has finished. When receiving this call, we load the delegate items (and build the table). A nice side effect is that the table will also be ready by the time Component.onCompeted is emitted to the QML app. This means that e.g contentWidth/Height has valid values. Change-Id: Ief92d2fecfaea54f6191da116ed4ba79cc673b01 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Store InternalClass::nameMap in a MemberDataLars Knoll2018-09-161-0/+0
| | | | | | | | | | This helps make that memory known to the GC as well, and makes marking of internal classes much more efficient, as we don't mark the property keys repeatedly (even if they are shared between different internal classes) Change-Id: Ibb7e5383672d7657926bd08bf13f73f7680a9f31 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Stabilize nestedSliderUsingTouch:keepNeither test on UbuntuShawn Rutledge2018-09-132-20/+4
| | | | | | | | | | | | | | | | For whatever reason, it seems we have to be less strict about the exact number of touchpoint movements that the TouchDragArea will see while being dragged 8 times. Counting those is really far from the main point of this test anyway. Also removed blacklisting of macOS 10.10 tests since we don't even support 10.11 anymore. Task-number: QTBUG-36804 Task-number: QTBUG-59840 Fixes: QTBUG-68867 Change-Id: I8f856c5b29de08f55dcd0273cd99dcda77cdf2c3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QQuickTableView: sync model and delegate when ready to do soRichard Moe Gustavsen2018-09-132-0/+128
| | | | | | | | | | | | | | | | | | Doing (silly) things in the delegate, like: Component.onCompleted: TableView.view.delegate = null will lead to a crash. The same if you change the model. The reason is that you end up changing the model while e.g a row is half-way loaded. Information needed for building the row, like model size, will then be invalid. To protect against this, we insert a "sync" phase to the code that takes any such changes into effect at a time when we know it's safe to do so. Change-Id: I85a992dfc0e04ec6635b10c9768a8ddc140e09da Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickTableView: override fixup() to preserve contentX/Y at start-upRichard Moe Gustavsen2018-09-112-13/+21
| | | | | | | | | | | | | | | | Flickable::fixup() will be called from Flickable::componentComplete(). fixup() is a virtual function that subclasses can override to e.g ensure that cells snap to grid etc (which is not yet supported by TableView). The default implementation will check if the assigned contentX/Y is within the current content item size, and adjust it back to 0,0 if not. The problem is that during componentComplete(), the table has not yet been built. And we don't want Flickable to reset any assignments to contentX/Y until that has happened. So override the function and block it from doing any adjustments before the table has been built. Change-Id: Id6c5a3b5f053f71bf1854573cd5b9dc3ecc9f246 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* 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>