summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta1Liang Qi2019-02-252-0/+37
|\ | | | | | | | | | | | | | | Conflicts: src/webchannel/qmetaobjectpublisher.cpp Done-With: Arno Rehn <a.rehn@menlosystems.com> Change-Id: I763a76cf055547c5c5e59511ded51c467d6c7526
| * Also add already wrapped objects to the transport-to-objects mapArno Rehn2019-02-042-0/+17
| | | | | | | | | | | | | | | | | | | | | | Fixes a crash: Previously, when a connection was closed, the transport was not removed from the list of transports of a wrapped objects. This was because the transport was not added to the transport-to-object map in the first place. When a property update was pushed, the now dangling pointer to the "old" transport caused a crash. Change-Id: Ib980f0b874851f8f85f7a3d76d51a2c884504b96 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * Correctly unwrap registered objectsArno Rehn2019-02-042-0/+20
| | | | | | | | | | | | | | | | | | Previously, only implicitly wrapped objects have been successfully unwrapped. "Officially" registered objects were not, and thus could not be passed to properties or as method arguments. Change-Id: I6b8644ed3be8db3a66c2c1d5bc167fc33a0b4165 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-alpha1Qt Forward Merge Bot2019-02-023-0/+6174
|\ \ | |/ | | | | Change-Id: I6b83cc26dddfafe3bebe1bfb3640e2daf2d9a8fb
| * Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-02-011-0/+6117
| |\ | | | | | | | | | Change-Id: I49e55df5f1c518ec62800572601e493f483faada
| | * Add binary compatibility file for QtWebChannel for Qt 5.12Milla Pohjanheimo2018-12-181-0/+6117
| | | | | | | | | | | | | | | | | | | | | Binary compatibility file added. Change-Id: I3faf447d11526f599fe826ac02d7f4c0815a7e8f Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| * | Correctly convert enums and QFlags from and to JSONArno Rehn2019-01-312-0/+57
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, enums declared with Q_ENUM were stringified in the conversion to JSON and QFlags did not work at all. The conversion of QJsonValue(int) to enum worked fine, however. This patch implements some extra logic for detecting enums and QFlags, thus correctly converting to and from integers. [ChangeLog] Enum values and QFlags are now correctly converted to and from integers in the JS interface Fixes: QTBUG-72924 Change-Id: I23d4a1120b805201c8d450edbd990aad5ad258a2 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Prevent crashes by fixing mapping of transport to wrapped objectsMilian Wolff2018-10-252-1/+35
|/ | | | | | | | | | | | | | | When an already-wrapped object was used by a secondary transport, the mapping was not updated. This could then lead to crashes when the transport was destroyed. [ChangeLog][General] Fix crash when wrapped objects are shared across multiple transports. Task-number: QTBUG-62388 Change-Id: I3c3b7302205e10f04695f1a202325704d90950d2 Reviewed-by: Kai Dohmen <psykai1993@googlemail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Add binary compatibility file for 5.11 for QtWebChannelMilla Pohjanheimo2018-06-051-0/+5987
| | | | | | | File for bic test added Change-Id: I30402c0a82d1079443d0f2a09b67cd4142a046b4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-203-1/+6046
|\ | | | | | | | | | | | | Conflicts: tests/auto/webchannel/tst_webchannel.h Change-Id: I454c1bbab153405541e7fc41d1389a810b94f2db
| * Merge remote-tracking branch 'origin/5.9' into 5.105.10Liang Qi2018-01-182-1/+64
| |\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Id5d79a1cd456c79ef35a323d1a8713facde2ef91
| | * Merge remote-tracking branch 'origin/5.9.4' into 5.9Liang Qi2018-01-181-3/+3
| | |\ | | | | | | | | | | | | Change-Id: Ib5e52f5be22b5a6430c4dfe731b0a0fe74ba0617
| | | * Clean up TestWebChannel::testAsyncObjectv5.9.45.9.4Sami Nurmenniemi2018-01-091-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-63152 Change-Id: I22df2328f0ab6d2a2d12458dbeaec68bfbe36985 (cherry picked from commit 5a9dd81f260f320b5af108c1a6b3d0b82a04f15d) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| | | * Fix TestWebChannel::testAsyncObjectSami Nurmenniemi2018-01-091-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If signal is emitted directly, QSignalSpy::wait() is called too late. In that case the correct information about emitted signal can be checked with QSignalSpy::count(). Task-number: QTBUG-63152 Change-Id: I0c3da52ab17f9138ad1a7a17f5065b8a87911b8f (cherry picked from commit d2f9396f048ef8fdd494626d92b3d7106fb10304) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| | * | Allow deleting a channel during method invocationJüri Valdmann2018-01-082-1/+64
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A real-life use case is the session restore page in KDE Falkon or, more generally, any kind of closeTab() method exposed to JS in a QWebEnginePage. The approach taken in this patch will only work if the transport can also deal with deletion during a messageReceived signal emission. Alternatively, method invocation could be delayed via the event loop, but this would come with an obvious performance penalty. Change-Id: I2940f61e07c77365f6e3e7cd29463d4cb5b525a6 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| * | Add binary compatibility file for QtWebChannel for 5.10Milla Pohjanheimo2018-01-091-0/+5982
| | | | | | | | | | | | | | | | | | | | | | | | File to test binary compatibility for 5.10 for QtWebChannel added Change-Id: I9697c942895106098b61639604faa0f94871dfcf Reviewed-by: Sergio Ahumada <sahumada@texla.cl> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-031-3/+3
|\ \ \ | |/ / | | | | | | Change-Id: I2e72cb69fb077e22571ce4bdc69abace00c37e7a
| * | Clean up TestWebChannel::testAsyncObjectSami Nurmenniemi2017-12-291-12/+3
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-63152 Change-Id: I22df2328f0ab6d2a2d12458dbeaec68bfbe36985 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Fix TestWebChannel::testAsyncObjectSami Nurmenniemi2017-12-281-3/+12
| |/ | | | | | | | | | | | | | | | | | | If signal is emitted directly, QSignalSpy::wait() is called too late. In that case the correct information about emitted signal can be checked with QSignalSpy::count(). Task-number: QTBUG-63152 Change-Id: I0c3da52ab17f9138ad1a7a17f5065b8a87911b8f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-213-3/+3
|/ | | | | Change-Id: I8661063408d17c80a04433beda595061e89b5ba8 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Do not crash on non-QVariant return typesMilian Wolff2017-08-082-10/+39
| | | | | | | | | | | | | Patch e354bdc5 introduced a regression that triggers a crash in Qt 5.9 when returning a type that is not implicitly convertible to QVariant, such as a QJsonValue, from an invoked method/slot. This patch fixes this situation and adds proper unit test coverage. Change-Id: Ib8cb0c96e7496bc8dc9a628245d7a44e4234aff0 Task-number: QTBUG-62045 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Kai Dohmen <psykai1993@googlemail.com>
* Update binary compatibility file for Qt5.9.0 for QtWebChannelMilla Pohjanheimo2017-06-301-0/+5661
| | | | | | | Binary compatibility file for Qt 5.9.0 updated. Change-Id: Ie1486ba7e4777fe88b03697f10ee6069f71ea575 Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Gracefully handle early deregistration of objectsMilian Wolff2017-05-152-0/+16
| | | | | | | | | | | When an object is deregistered before the signal handler got initializated, we asserted. Now, we check for this case and skip the signal handler removal when it wasn't set up yet. Change-Id: I7abad204cbab72be7729d42f58ce63babd2310d8 Task-number: QTBUG-60250 Reviewed-by: Kai Dohmen <psykai1993@googlemail.com> Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
* Fix licensingJani Heikkinen2017-05-052-34/+24
| | | | | | | | | | | - Replace old LGPL21 license headers with GPL-EXCEPT one (which is currently used in tools and tests) - Remove old, unnecessary license files Task-number: QTBUG-57147 Change-Id: I33e9a2e6771874dbbc7281f96f09a4fc03d57b54 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Binary compatibility file for qtwebchannel (5.8.0)5.8Milla Pohjanheimo2017-02-031-0/+5641
| | | | | | | | Added binary compatibility file for qtwebchannel Change-Id: I4a5f32fe50ac08885b8eb574d3abe9b931c13040 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-265-0/+11025
|\ | | | | | | Change-Id: I09a494a9b94ce169d60e77f4bffa8845db01293a
| * Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-242-0/+5329
| |\ | | | | | | | | | Change-Id: I773dacf2a5513327db8be0837e7514685cbd1dc4
| | * BC include file and global.cfg added for QtWebChannelMilla Pohjanheimo2016-10-132-0/+5329
| | | | | | | | | | | | | | | | | | | | | Means to run the binary compatibility (BC) test for QtWebChannel added Change-Id: I6684b34d10c44340aa852bf9eae81b35e1ae4d2b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | BC file added for QtWebChannel (5.7)Milla Pohjanheimo2016-10-141-0/+5606
| | | | | | | | | | | | | | | | | | | | | Binary compatibility (BC) file for QtWebChannel added Change-Id: I4de49243be8d77eb0295b653dba2dd75379361fa Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-012-0/+90
| |\ \ | | |/ | | | | | | Change-Id: Ib8b5300d27583018bc7582be41140dfda0ab5309
| | * Fix asynchronous signals from QObjects in different threadsDave Andrews2016-09-292-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switches the signal listener in QWebChannel from using Qt::DirectConnection to Qt::AutoConnection to relay signals from QObjects in different affinities than the QWebChannel. Also adds a unit test in testAsyncObject() to verify that QWebChannel no longer crashes when receiving such a signal, and that such objects can be added and removed dynamically. Task-number: QTBUG-51366 Change-Id: I51a4886286fec9257a21ea95360c1ea8889a584a Reviewed-by: Dave Andrews <jetdog330@hotmail.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| | * Fix asynchronous method calls on QObjects in different threadsDave Andrews2016-09-292-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QMetaMethod::invoke without a return for void method calls, which allows making asynchronous method calls onto QObjects in different affinities than the QWebChannel that's emitting them. Also adds a unit test called testAsyncObject that intentionally places a QObject in a different affinity and then tests calls into it from the QWebChannel's synchronous publisher. Task-number: QTBUG-47678 Change-Id: I6c35ee54f764c0fc1b0431fb0774aa7e75039abf Reviewed-by: Dave Andrews <jetdog330@hotmail.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-037-26/+188
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/webchannel/tst_webchannel.cpp tests/auto/webchannel/tst_webchannel.h Change-Id: I01b0f58c10acbef8e2d5d15fc5787e755f519af8
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-017-3/+220
| |\ \ | | |/ | | | | | | Change-Id: If2a4f50d03fccc2654b8336d9e40daea85d6adca
| | * Add a test that emits signals from C++ and checks them in QMLv5.6.25.6.2Milian Wolff2016-07-215-3/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is again trying to reproduce the issue described in the bug report, but it also passes for me. Still, it's good to have this tested in more depth. Change-Id: Ibaaefd7359d558c3b59af3d86a1260ab06caa598 Task-number: QTBUG-54074 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * Remove deleted transport objectsKai Dohmen2016-07-212-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a QMultiHash which maps transport objects to wrapped object ids. transportRemoved iterates over all matching wrapped objects and removes the passed transport object from their transports-vector. If the transports-vector is empty after removing the passed transport object the objectDestroyed will be called on the wrapped object. transportRemoved will be called either on the transports destoryed signal or on disconnecting the webchannel from it. Without this changes the QMetaObjectPublisher::wrappedObjects and ::registeredObjectIds would only be cleaned up if the website calls deleteLater on QObjects but not on website reloads. Task-number: QTBUG-50074 Change-Id: If294564fee2406edd7fb578852aeb269cac23a92 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> (cherry picked from commit fa2374d7c4dedea907e2df26fdad28bdee73b122) Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-213-5/+270
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/webchannel/doc/src/index.qdoc src/webchannel/qwebchannelabstracttransport.cpp Overlapping changes to documentation; constructed hybrid. src/webchannel/qmetaobjectpublisher.cpp tests/auto/webchannel/tst_webchannel.cpp tests/auto/webchannel/tst_webchannel.h Both sides made additions; in the same place. Change-Id: Iff12970978b70946dc3e1290841aca2d35c9c1d0
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-153-5/+270
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alleged Conflicts: examples/webchannel/chatclient-html/doc/src/chatclient-html.qdoc examples/webchannel/chatclient-qml/doc/src/chatclient-qml.qdoc examples/webchannel/chatserver-cpp/doc/src/chatserver-cpp.qdoc In each case, the two sides agreed byte-for-byte. Not quite sure what git thought the conflict was ! Change-Id: I5da9695b667f4112848c520b630ab1304d61cea3
| | * Add test to verify that bools get properly converted.Milian Wolff2016-07-132-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | This test passes and seems to indicate that the signal-delivery has an issue, or that the issue lies on the JavaScript side. Change-Id: Ic2436147b3af49d35dc556da57aed3e54408f1f9 Task-number: QTBUG-54074 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * Properly unwrap QObject signal parameters on the JavaScript side.Milian Wolff2016-06-281-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables you to pass `QObject*` parameters via signals to the JavaScript side. The object will be serialized and then unwrapped as needed now. Task-number: QTBUG-54243 Change-Id: Ie8a6d14eb1351f14f1855d242ceb3b3f8262152d Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
| | * Make passing objects from website to server possibleKai Dohmen2016-06-212-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you get an object from the server and want to pass it back to the server via a function the id of the object is passed instead of the whole json object. On the server side QMetaObjectPublisher::invokeMethod now looks up the object in QMetaObjectPublisher::wrappedObjects by the passed object-id. Task-number: QTBUG-50075 Change-Id: Id0df2dfaa79bcba12ca48391ae7537ac1a086898 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| | * Fix setting properties of QJson{Value,Array,Object} type.Milian Wolff2016-05-262-4/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the previous issue, where these types were not properly converted to QVariant when invoking a method, we manually do the conversion now to get the desired behavior. The culprit is again that QJsonValue::toVariant converts an object e.g. to a QVariantMap, and not to a QVariant containing a QJsonObject. [ChangeLog] QObject properties of type QJsonValue, QJsonArray or QJsonObject can now be set via the Qt WebChannel. Task-number: QTBUG-48198 Change-Id: I5d574b1a5cffd6d6ad9b555f2a3e872b9c3425a7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Enable calling C++ functions taking QJson arguments via webchannel.Milian Wolff2016-05-252-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to convert the QJsonValue arguments to QVariants, which then failed to call a C++ function which expected on of the three QJson data types, i.e. QJsonValue, QJsonObject or QJsonArray. Instead, we now detect these three cases and manually convert the QJsonValue as needed. [ChangeLog] C++ functions taking arguments of type QJsonValue, QJsonArray or QJsonObject can now be called via the Qt WebChannel. Change-Id: I94e0c8937ca35e2ecd3554f7ddf2d4e5a3328570 Task-number: QTBUG-48198 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove deleted transport objectsKai Dohmen2016-05-312-0/+55
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a QMultiHash which maps transport objects to wrapped object ids. transportRemoved iterates over all matching wrapped objects and removes the passed transport object from their transports-vector. If the transports-vector is empty after removing the passed transport object the objectDestroyed will be called on the wrapped object. transportRemoved will be called either on the transports destoryed signal or on disconnecting the webchannel from it. Without this changes the QMetaObjectPublisher::wrappedObjects and ::registeredObjectIds would only be cleaned up if the website calls deleteLater on QObjects but not on website reloads. Task-number: QTBUG-50074 Change-Id: If294564fee2406edd7fb578852aeb269cac23a92 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Updated license headersAntti Kokko2016-01-2012-205/+145
|/ | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I1c2917ddcb2436477aefde3dc640155d5131a664 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Support subclass property getters and setters.Pierre Rossi2015-07-083-0/+212
| | | | | | | | | | | | | | | QDialog for instance adds a setter for the modal property already exposed by QWidget. Object.defineProperty requires configurable set to true in order to add that setter at a later stage. Adds some reusable autotest logic with a soft dependency on QJSEngine to test some of the C++/JS integration aspects. Task-number: QTBUG-46548 Change-Id: Ibd49274f7d334c068c4006fb09417abf911c24e9 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Fix wrap registered object issueLutz Schönemann2015-05-152-0/+76
| | | | | | | | | | | | | | | | When wrapping a registered object the code generated a new ID for an already known object. That new ID wasn't stored but returned to the client including the objects information. That resulted in a new created object on client side but the remote object (on the server) was not accessible. This patch fixes the issue by just returning the known ID of a known object. Because the client already has a local representation of that object it does not have to unwrap the object description. Change-Id: I31964823c84c84fd7ebce4386865c18fb5518be7 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Update copyright headersv5.5.0-alpha1Antti Kokko2015-02-1712-72/+72
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Iebed549451f58a9fbdd86adf5d0340412d7766d7 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Merge branch '5.4' into devMilian Wolff2015-02-045-27/+70
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This merge required extensive conflict handling because the bug fix in 5.4 to properly wrap and forward QObjects referenced by published objects' properties clashed with some feature additions in dev, namely the client separation logic. All unit test pass for me locally now again. Conflicts: .qmake.conf src/webchannel/qmetaobjectpublisher.cpp tests/auto/qml/tst_webchannel.qml Change-Id: If3d00e13b265c6ab9fb2c38023014f97f8e7779b
| * Fix crash on signal after deregistrationLutz Schönemann2014-12-032-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented a remove method in SignalHandler that allows us to remove and disconnect an object from SignalHandler w/o decrementing the connection counter until it hits zero or deleting the object That same functionality was used to remove an object from internal lists when receiving a destroyed signal from an object. In case of deregistering an object we haven't received a destoryed signal but simulated reception of that signal and so that code was not called in that case. Change-Id: Ie20cf628a2de028375f5d29f913682e25ebf8d44 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>