summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Add some C++ tests for QWebChannel and QMetaObjectPublisher.Milian Wolff2013-12-274-0/+273
| | | | | | Change-Id: I6a852e1545e7aac0f9f8d83010a3e905524a8069 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Restructure sources and assimilate to Qt module structure.Milian Wolff2013-12-1217-14/+24
| | | | | | | | | | | | | | | | | | | | | This module can hopefully be done in time for 5.3. This commit changes the source structure and QMake files to adapt to typical Qt modules. With this in place, we can now use QT += webchannel in qmake files to link against the pure Qt/C++ QtWebChannel library. The QML plugin is separated from it and can be loaded optionally, if the quick module could be found. Also added is now a qmlplugindump for tooling integration. Note that the Qt.labs namespace is removed. The test file structure is also adapted to how its done in the QtDeclarative module. Note that this setup apparently does not support to run tests without running make install first. Change-Id: I1c15d72e7ab5f525d5a6f651f4e965ef86bc17bd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Port the MetaObjectPublisher to C++.Milian Wolff2013-12-113-57/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow us to create a stand-alone WebChannel C++ library, without any QML dependencies, that can be used to publisher QObjects to remote clients running in any browser engine supporting WebSockets. The patch is large, as working with introspection through the QMetaObject from C++ is more complicated compared to QML. On the other hand, the move to C++ allows a much more performant implementation of quite some parts of the publisher. One thing is that signal and method invocations can be handled via numeric indices, where before we needed to transmit the string identifier of the signal or method. Eventually this can now also be applied to properties, further decreasing the size of messages between server and clients. Note that this patch contains quite some TODOs and rough edges, such as the invokable bench_* helper functions in the public API of the MetaObjectPublisher. These are to be seen as temporary, and will be cleaned up in followup commits later. This is done to prevent a further blow-up of this already big patch. Change-Id: I57e788d8a19edd410651611382d912f9ad6660c9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make it possible to disconnect from signals on the client side.Milian Wolff2013-12-052-1/+64
| | | | | | | | To do so, we need to remember the connected functor and pass that to disconnect, in both the client side as well as the QML server side. Change-Id: Ic61fc5d2a203212278c23471c216683e309e2c9f Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Test QObject wrapping, when factory-style methods are called.Milian Wolff2013-11-252-1/+108
| | | | | | | | | | | | | | An HTML client can trigger the creation of new objects, or a published object on the server side might return other objects. These are then wrapped on the fly and can be used like the other objects. Note though that the HTML client can call deleteLater on these objects. Also, it does not yet work to wrap objects on the fly in signal arguments or property values. Change-Id: I92aa8a3e52f42d5325dd0771bbf9e2ae213e88f9 Reviewed-by: Arvid Nilsson <anilsson@blackberry.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add benchmarks for the MetaObjectPublisher.Milian Wolff2013-11-252-0/+175
| | | | | | | | | | | This runs benchmarks on various functions of the MOP with hundred objects each containing ten properties, signals and methods. Furthermore a function is included which benchmarks the whole roundtrip of loading a simple client and waiting for it to be initialized. Change-Id: If51c5b5f606151885611cabc0e1330bd2643ad67 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add a test for the property update grouping.Milian Wolff2013-11-222-1/+50
| | | | | | | | | | | For performance reasons, we group property updates and send a single batch update notification. This is now tested to work as intended. This also uncovered a bug in webchannel.js when multiple functions subscribe to the same id. Change-Id: Ic8648d664dd1fe54df7e25fade6a6088386af992 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add an initial test suite for the MetaObjectPublisherMilian Wolff2013-11-227-72/+356
| | | | | | | | | | | | | | This tests the functionality of publishing a plain QtObject from QML to the HTML client. It tests property binding, i.e. reading and writing of an objects property on the client side, as well as change notification tracking. Furthermore a server-side method is invoked from the client and signal submission from the server to the client is tested. Change-Id: I62e544cddf4483b57535a9bc1e05a36105ec6622 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add test for QWebChannel::ping-sending and pong-receival.Milian Wolff2013-11-201-0/+14
| | | | | Change-Id: Ia449851bd0312435882c0238ab46f8316e38b72f Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add test for webchannel.respond on the QML and .exec on the HTML side.Milian Wolff2013-11-142-0/+29
| | | | | Change-Id: I5eec7bc87bc56de6dd918d90f2fe9ee86d72b434 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add unit test harness for QWebChannel and two initial tests.Milian Wolff2013-11-146-0/+191
This uncovered a bug in webchannel.js, which stringified strings leading to duplicated quoting. This is also fixed now. Furthermore, some QMake changes are required to make it possible to run the tests without first installing QWebChannel. Change-Id: If7e8f73a748f86f2d5c7d39000e90612367038af Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>