aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
Commit message (Collapse)AuthorAgeFilesLines
* Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-0384-84/+2
| | | | | Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.Friedemann Kleint2015-09-028-28/+19
| | | | | | | Fix usage of API that is marked deprecated. Change-Id: Ia887437f99b9ce207891ca19bc49294acb7d629d Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Fix use of function expressions with signal handlersSimon Hausmann2015-08-242-0/+17
| | | | | | | | | | | | | | | | | | | | Writing onClicked: function(mouseEvent) { ... } would get silently "accepted" by the engine, but it wouldn't do anything. We basically wrapped it in a new function, so that it became onClicked: function(mouse){ function(mouseEvent() {} } which is a noop. With older versions this used to produce a syntax error. However the better fix is to simply support this kind of assignment for more expressive signal handlers, because now the names of the signal parameters can be explicitly named (with names of your choice). Change-Id: I96369f8805fab97509784222f614ee17cf681aba Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Cleanup qmlcontextwrapper usage in XHRLars Knoll2015-08-201-3/+3
| | | | | | | | | | | | | | | Get rid of the static getContext overload and simplify the signature of the dispatchCallback method in XHR. Get rid of the m_me object, and instead store a pointer to the thisObject and the context data directly. Turn all internal errors into assertions. Change-Id: I5427b2009c64f54b67cce1c130eace47201624bd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Hold a pointer to the QV4::ExecutionEngine in the property cacheLars Knoll2015-08-191-6/+13
| | | | | | | This makes more sense than a pointer to the QQmlEngine. Change-Id: Ic6037b0df63b6cf1585539bc3ac78822f0e69d02 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Clean up data format for V4 debug connectionUlf Hermann2015-08-191-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the type announced for functions to the actual JavaScript type "function". The type for null is also wrong: it should be "object". However, older QtCreators cannot distinguish between null and {} if null gets the correct type, unless you explicitly compare x === null in an expression evaluator. For this reason the fake "null" type is kept for now. Also, the value field of undefined is now set as QJsonValue::Undefined which causes it to be omitted when sent over the wire. This is the logical thing to do. In addition we add type and value fields for all data members mentioned in a response, not only the ones specifically asked for. The value field is the actual value for any primitives (including strings), or the number of properties for composite types: objects, arrays, functions. In turn, the "ref" members are omitted for primitive types, so that we don't have to hold references to them in the debug service anymore. Even old QtCreators can deal with verbatim data members without "ref". Task-number: QTBUG-47746 Task-number: QTBUG-47747 Change-Id: I773e6418c39cd9814aadb5fb5ef7e109f9a4e618 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fix test caseLars Knoll2015-08-181-2/+3
| | | | | | | | After the latest changes to the VMEMO, JS declared properties will not be available after the engine is deleted. Change-Id: Ifc6034bd0dff18d26863ca9bcf7a19e1c7d68ff6 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of special handling of var propertiesLars Knoll2015-08-181-0/+6
| | | | | | | | | | | | These can be handled in a simple way now by using a special propertyType value indicating that we have a var property. Also remove the additional write calls in the different readProperty implementations. If the stored data doesn't match, we can simply return the default value directly. Change-Id: I3823a971df24bd78f0acdc4c0042776277b3c55f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Ulf Hermann2015-08-187-1/+258
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qv4debugservice.cpp src/qml/jsruntime/qv4value_inl_p.h src/qml/jsruntime/qv4value_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/qml/qqmlnotifier_p.h src/qml/qml/qqmlproperty.cpp src/quick/items/qquickflickable.cpp src/quick/items/qquicktextedit.cpp tests/auto/quick/qquickwindow/BLACKLIST The extra changes in qqmlbinding.cpp are ported from changes to qqmlproperty.cpp that occurred in parallel with writeBinding() being moved to qqmlbinding.cpp. Change-Id: I16d1920abf448c29a01822256f52153651a56356
| * Fix possible stack overflow with many property bindingsEskil Abrahamsen Blomfeldt2015-07-211-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are a lot of bindings to the same property (like 20 000), we would get stack overflows because the notify list for the changed signal was traversed recursively. Changing this also speeds up the traversal. I see something like ~40% reduction in the case of layout() for a notify list of around 200 items. Note: To make it possible to traverse the double-linked list backwards, the next-pointer needs to be moved to the beginning of the struct, because the implementation pattern assumes this (node->next->prev = &node->next). I think this code has rotted after it was added, since the prev pointer was never actually used anywhere before. Change-Id: Icdfac50b7c8584a908efa65694c7f5f416cb153b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * fix readonly metaproperties (revealed by compiler warning)Shawn Rutledge2015-07-212-0/+23
| | | | | | | | | | | | | | Found thanks to -Wparentheses + gcc 5.1 Change-Id: Iad784a26d268b85f7c67623fd63f0b097a9f29f9 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * Test if the state machine reacts to a QObject signal.BogDan Vatra2015-07-154-1/+201
| | | | | | | | | | Change-Id: I4987e10ac0b31977249ce9ebe00e26de334db30d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Allow specification of loadable debug services via command lineUlf Hermann2015-08-136-125/+161
| | | | | | | | | | | | | | | | | | We don't want to load the debugger when profiling and vice versa. This makes it easier to prevent unwanted services from getting loaded. Task-number: QTBUG-47623 Change-Id: I28893b6218110274a6d30b27805d89dbb443add3 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Move DataCollector into debugger pluginUlf Hermann2015-08-102-15/+33
| | | | | | | | | | | | | | | | The data collector and all the jobs it uses to interact with the engine are only used from the debugger plugin. We can as well move them there. Change-Id: Ia48251f08b48c7e1e607b8ae2a3d1de29f80f742 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Move V4 debugger agent into the debugger pluginUlf Hermann2015-08-101-30/+34
| | | | | | | | | | | | | | | | | | | | The debugger is the only thing that actually needs it. Note that for this to work we need to make QV4::Debugging::Debugger a QObject and add some signals. The net effect is still a reduction in binary size of about 1kb. Change-Id: Ibecb8cfa140fc26fc13c8cbefb3d027ebdcd28a4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Change data collection for debugging to use QV4::Value.Ulf Hermann2015-08-101-131/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the variable collection to store QV4::Value values into a JS array, which is retained by the collector. This prevents any GC issues, and gives a nice mapping from handle (used in the debugging protocol) to JS value. It also allows for easy "shallow" object serialization: any lookup can start with the QV4::Value, and add any values it encounters to the array. Testing is changed to use this collector directly, thereby testing the class that is actually used to generate protocol data. Task-number: QTBUG-47061 Change-Id: Iec75c4f74c08495e2a8af0fedf304f76f8385fd7 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Don't call the test method assertLars Knoll2015-08-091-2/+2
| | | | | | | | | | | | | | | | Mac OS X apparently uses a macro for assert(), completely breaking compilation of this file Change-Id: I51379da6e0c702e4d021dcd9a84af39889d24c2d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Prospective build fix for autotest on mac os xLars Knoll2015-08-091-0/+4
| | | | | | | | | | Change-Id: I6b3182ed8b59e889fd11da08d8240ee5cf7d0e91 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Periodically flush profiling data to client.Ulf Hermann2015-08-043-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces memory usage as the data can be deleted once it is sent. It also reduces the time it takes to transmit the data when profiling is stopped. It does incur a runtime cost as the sending now takes place while the application is running. The decision to periodically flush or not is left to the client, who can specify a flush interval when starting profiling. Usage of the flushing feature also relaxes the guarantees regarding the sorting of events before they are sent. Events with higher timestamps are now allowed to arrive before events with lower timestamps. Any clients implementing the flushing need to take this into account. This will eventually allow us to do away with the server-side ordering altogether. Task-number: QTBUG-39756 Change-Id: Idaf4931dc17f224c2bd492078b99e88b1405234e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use signal/slot for passing messages through QQmlDebugServerUlf Hermann2015-07-313-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This results in much cleaner code than the previous implementation using QMetaObject::invokeMethod(). We have to use read locks now for adding and removing engines, as we should have done already before. If a condition is waiting on a write lock you cannot acquire a read lock from another thread. So, if we kept the write locks we wouldn't be able to receive messages while the engines are waiting. Change-Id: Icfe641601dec2f8d7181ae579146ed603d57a4c2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Make QQmlDebugService::registerService() private and part of ctorUlf Hermann2015-07-304-97/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By forcing all debug services to register before the thread starts we can get rid of the complicated thread synchronization and have a more natural API for the services. We can also better enforce the thread situation when registering services in QQmlDebugServer now. QQmlProfilerService should not moveToThread() in its constructor as the thread has not been started, yet. The thread affinity of QQmlProfilerService doesn't make any difference anyway, as all relevant methods are protected by mutexes and it doesn't have any slots. Change-Id: I57db9e2bf94ec6884ede694715dadf5bfd687334 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Extract minimal interface from QQmlDebugServer and use it.Ulf Hermann2015-07-304-6/+0
| | | | | | | | | | | | | | | | | | | | This will allow us to move QQmlDebugServer into a plugin. The new QQmlDebugServer is the interface exposed to connection plugins. The interface exposed to services is renamed to QQmlDebugConnector, as technically it doesn't have to be a "server". Change-Id: Id508b8c0a6960228e889f45a437b73060392db39 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Use QVector rather than QList for storing QQmlProfilerDataUlf Hermann2015-07-291-6/+6
| | | | | | | | | | Change-Id: I94519181e915c5e2df9614ad4e1180fb159252e3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QQmlDebugService::objectToString()Ulf Hermann2015-07-291-13/+0
| | | | | | | | | | | | | | It isn't used anywhere. Change-Id: I73e2f448be30c04dca4d7122d173782e302478bd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove some methods from QQmlDebugServerUlf Hermann2015-07-294-6/+0
| | | | | | | | | | | | | | They were only used internally or for redundant checks in the tests. Change-Id: Iaa7d52be030adaa52a07b28fba53bdef9fada879 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove static proxy methods from QQmlDebugServiceUlf Hermann2015-07-294-5/+11
| | | | | | | | | | | | | | | | | | They all internally map to one-liners and just add to binary size and complexity. Especially, the most used one, isDebuggingEnabled(), simply checks if there is a QQmlDebugServer::instance(). Change-Id: Ib269928e08506894d933f6696e34ff0d3acb048b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-2929-367/+368
| | | | | | | | | | | | | | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I8cc97fd9b48fc789a849e9527c292c4e05accd97 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).Friedemann Kleint2015-07-277-128/+128
| | | | | | | | | | | | | | | | Preparing the replacement of Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) for non-boolean types. Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Make tst_QQmlInspector::reloadQmlWindow() fail more quicklyUlf Hermann2015-07-221-2/+2
| | | | | | | | | | | | | | | | It's annoying that we have to wait for 5s, just for the confirmation that QTBUG-33376 isn't fixed. Change-Id: I6296cc05d6dc7240ec3182ff10b19e40d5d4e599 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | With -no-qml-debug, don't compile debug plugins and testsUlf Hermann2015-07-181-1/+1
| | | | | | | | | | | | | | | | This eliminates many #ifdefs and prevents the compilartion of broken plugins. Change-Id: Ib2763ed9e6580307482b885d71c1ad1010959ef2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QML Engine: Support for "PROPFIND" method for XMLHTTPRequestValery Kotov2015-07-189-0/+657
| | | | | | | | | | | | | | | | | | | | | | | | Support for WevDAV PROPFIND method was added to QQmlXMLHttpRequest. Tests for PROPFIND method in XMLHttpRequest were added. [ChangeLog][QtQml][QQmlXMLHttpRequest] QQmlXMLHttpRequest now supports the PROPFIND method in HTTP requests. Task-number: QTBUG-36456 Change-Id: Ie36fcc901e7c1583840f04166c1774a1defe9308 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Adapt to deprecation of QProcess::error(...) signalUlf Hermann2015-07-151-1/+1
| | | | | | | | | | Change-Id: Icf708af4ab968c6592f78f90c3758e30dbe9195d Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Fix tst_qqmldebuglocal on QNX.Rafael Roquetto2015-07-101-1/+1
| | | | | | | | | | | | | | | | | | QNX does not place library functions on the default namespace. Either use namespace std or explicitly state the namespace prefix. Change-Id: I1037c16316b9545ea6214289a3af9a549e83613c Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-3011-15/+23
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/qml/qqmlengine.cpp src/quick/items/qquickitemsmodule.cpp tools/qml/main.cpp Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
| * Merge remote-tracking branch 'origin/5.5.0' into 5.5Liang Qi2015-06-266-10/+18
| |\ | | | | | | | | | Change-Id: I4020a1b3c59dea18faf7cbcbb78b90fcfc3680f0
| | * Make argument to QQmlDebuggingEnabler::startTcpServer an enumUlf Hermann2015-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The bool argument is less intuitive as you don't know if e.g. true means "Yes, run the QML" or "Yes, block the QML engine". Task-number: QTBUG-46565 Change-Id: I6d268e1354cebeb794b065e118bc0c353d7dd59a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Add left, right, top and bottom properties to basic QML rect type.Mitch Curtis2015-06-035-8/+16
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-45528 Task-number: QTBUG-45530 Change-Id: I83c4056b4bde37ef2dc4424ffddd823c1654d92e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | Improve qml error message "invalid alias location"Aleix Pol2015-06-105-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Specify we're talking about the target itself rather than talking location, which I always doubt about whether it's the location within the file. Also specify the offending property, so we get a clue about what to look into. [ChangeLog][QtQml] Improve "invalid alias location" error message by specifying what's the offending property and by calling it "invalid alias target location" Change-Id: I7a9390089ee8986872c119df44d8036bf267ab99 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Add option to use a local socket for QML debuggingUlf Hermann2015-06-266-8/+232
| | | | | | | | | | | | | | | | | | | | Using a TCP debug server comes with a number of drawbacks. It has a larger overhead than other connection types, the application has to be able to access the network and there has to be an open port we can find somehow. Change-Id: Ia7fb24006b89419988c6504797303d84c3aa1bbc Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Make QQmlDebugService ctor protectedUlf Hermann2015-06-261-2/+2
| | | | | | | | | | | | | | No one needs a bare debug service. Change-Id: I45a2f2437f51197707af2743faad1845b8007053 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Clear stringCache explicitly instead of asserting its emptiness.Dmitry Volosnykh2015-06-253-0/+79
| | | | | | | | | | | | | | | | | | This assumption does not hold when PathView's path.pathElements list is updated with new contents at runtime. Task-number: QTBUG-46255 Change-Id: I6b0d7ee8ee2d67ca0138eacdf0ad221338f788e4 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Force completion of asynchronously loaded components.Robert Griebl2015-06-231-0/+30
| | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick][QQmlComponent] Synchronously complete the loading of a Asynchronous QQmlComponent, if a PreferSynchronous QQmlComponent is created for the same url (given that this url does support synchronous loading). Change-Id: I3291d0569a69bac2aeb4815f1068a426ef2707ef Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Fix some function signatures and remove an unused functionLars Knoll2015-06-181-17/+17
| | | | | | | | | | | | | | | | The returned value of these methods is never used, so save some cycles and return void. Change-Id: I7e2430130853af12de9685c4383197c80c151175 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Get rid of QQmlBoundSignalExpression::ExtraDataLars Knoll2015-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The extra data was only used to delay initialization of the required FunctionObject to the first time evaluate got called. In addition, the constructor using ExtraData was only ever called from the debugger. In that case performance can't be critical, so we can just as well do function object creation at construction time. This saves one pointer in the object. Change-Id: I46ce9aa325f0fa95b5b0e374e9c07d673e454dd4 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Verify that debug client exists before interacting with it.Ulf Hermann2015-06-162-2/+6
| | | | | | | | | | | | | | | | We don't want the tests to crash if the connection cannot be established. Change-Id: Iebd6d008f6a043b229738d607068ea822fcded9d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Don't wait forever in QQmlDebugClient testUlf Hermann2015-06-151-2/+1
| | | | | | | | | | | | | | | | The test is intended to wait for 5 seconds but in fact it waited for 5 * 30.1 seconds. Change-Id: Id2af7513fc7af6ab5e67d04d802a24744483f5e1 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Initialize members of tst_QQmlEngineDebugServiceUlf Hermann2015-06-151-0/+2
| | | | | | | | | | Change-Id: Id9fe7d2bd630bcfe79634b3a4465ec7ad764d18c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Make bindings refcountedLars Knoll2015-06-101-39/+39
| | | | | | | | | | | | | | | | | | | | | | Refcounting our bindings greatly simplifies our memory management of the objects and ensures we safely clean them all up. In addition, it allows us to remove the m_mePtr and weak reference handling from QQmlAbstractBinding as we can safely handle this through the same mechanism. Change-Id: If23ebc8be276096146952b0008b62018f5d57faf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | ObjectModel: add API for dynamic changesJ-P Nurmi2015-06-103-1/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the ListModel API: - object get(index) - append(object) - insert(int index, object) - move(int from, int to, int n) - remove(int index, int n) [ChangeLog][QtQml][ObjectModel] Added get(), append(), insert(), move() and remove() methods. Change-Id: I592e55b7c4c933a1100191bf5a9405944b347172 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* | Blacklist unstable tests for nowSimon Hausmann2015-06-051-0/+2
| | | | | | | | | | Change-Id: Ia29b103c33afd9aafe9ee36ee4447fab17fe00c7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>