diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2015-02-04 19:12:12 +0100 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2015-02-04 19:12:12 +0100 |
commit | 801076803ce92d7bd646a58c792015c2b833d0c5 (patch) | |
tree | b9bc16705a541cf402ee4614da7115135efb19d5 /tests/auto/qml/tst_webchannelseparation.qml | |
parent | 9d705911391c456813ce54a52f70aa2ccbc5b553 (diff) | |
parent | 358e5acba3154a8ab4b53b22797c2c1eae4707dc (diff) | |
download | qtwebchannel-801076803ce92d7bd646a58c792015c2b833d0c5.tar.gz |
Merge branch '5.4' into dev
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
Diffstat (limited to 'tests/auto/qml/tst_webchannelseparation.qml')
-rw-r--r-- | tests/auto/qml/tst_webchannelseparation.qml | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/auto/qml/tst_webchannelseparation.qml b/tests/auto/qml/tst_webchannelseparation.qml index 289f8b2..8a74243 100644 --- a/tests/auto/qml/tst_webchannelseparation.qml +++ b/tests/auto/qml/tst_webchannelseparation.qml @@ -91,15 +91,16 @@ TestCase { } WebChannel.id: "myObj3" } + + property var lastFactoryObj + property var createdFactoryObjects: [] QtObject { id: myFactory - property var lastObj - property var createdObjects: [] function cleanup() { - while (createdObjects.length) { - var obj = createdObjects.shift(); + while (createdFactoryObjects.length) { + var obj = createdFactoryObjects.shift(); if (obj) { obj.destroy(); } @@ -108,9 +109,9 @@ TestCase { function create(id) { - lastObj = component.createObject(myFactory, {objectName: id}); - createdObjects.push(lastObj); - return lastObj; + lastFactoryObj = component.createObject(myFactory, {objectName: id}); + createdFactoryObjects.push(lastFactoryObj); + return lastFactoryObj; } WebChannel.id: "myFactory" } @@ -146,7 +147,8 @@ TestCase { client2.debug = false; // delete all created objects myFactory.cleanup(); - myFactory.lastObj = undefined; + lastFactoryObj = undefined; + createdFactoryObjects = []; // reschedule current task to end of event loop wait(1); } @@ -160,7 +162,7 @@ TestCase { var channel1 = client1.createChannel(function (channel1) { channel1.objects.myFactory.create("testObj1", function (obj1) { - testObj1 = myFactory.lastObj; + testObj1 = lastFactoryObj; testObj1Id = obj1.__id__; obj1.mySignal.connect(function (arg1_1, arg1_2) { @@ -182,7 +184,7 @@ TestCase { channel2 = client2.createChannel(function (channel2) { channel2.objects.myFactory.create("testObj2", function (obj2) { - testObj2 = myFactory.lastObj; + testObj2 = lastFactoryObj; testObj2Id = obj2.__id__; obj2.mySignal.connect(function (arg2_1, arg2_2) { console.debug("client 2 received signal 'mySignal'"); @@ -278,7 +280,7 @@ TestCase { var channel1 = client1.createChannel(function (channel1) { channel1.objects.myFactory.create("testObj1", function (obj1) { - testObj1 = myFactory.lastObj; + testObj1 = lastFactoryObj; testObj1Id = obj1.__id__; obj1.myPropertyChanged.connect(function (arg1_1) { @@ -300,7 +302,7 @@ TestCase { channel2 = client2.createChannel(function (channel2) { channel2.objects.myFactory.create("testObj2", function (obj2) { - testObj2 = myFactory.lastObj; + testObj2 = lastFactoryObj; testObj2Id = obj2.__id__; obj2.myPropertyChanged.connect(function (arg1_1) { console.debug("client 2 received property update 'myProperty' " + obj2.myProperty); |