@@ -69,9 +69,12 @@ Rectangle {
71 property int index: -1
71 property int index: -1
72+ property bool changeIcon: true
72 interval: 500
73 interval: 500
73 onTriggered: {
74 onTriggered: {
74− actionDataActions.actions[index].icon = Qt.resolvedUrl("../../UnityLogo.png");
76+ actionDataActions.actions[index].icon = Qt.resolvedUrl("../../UnityLogo.png");
75 preview.widgetDataChanged();
78 preview.widgetDataChanged();
76 index = -1;
79 index = -1;
@@ -89,12 +92,14 @@ Rectangle {
90 function test_checkButtonWithTemporary_data() {
93 function test_checkButtonWithTemporary_data() {
92− {tag: "with temporary", temporaryIcon: "emblem", index: 0},
95+ {tag: "with temporary change icon", temporaryIcon: "emblem", index: 0, changeIcon: true},
96+ {tag: "with temporary no change icon", temporaryIcon: "emblem", index: 1, changeIcon: false},
93− {tag: "without temporary", temporaryIcon: undefined, index: 2},
97+ {tag: "without temporary", temporaryIcon: undefined, index: 2, changeIcon: true},
97 function test_checkButtonWithTemporary(data) {
101 function test_checkButtonWithTemporary(data) {
102+ waitForRendering(preview);
98 spy.target = preview;
103 spy.target = preview;
100 var buttonId = actionDataActions.actions[data.index].id;
105 var buttonId = actionDataActions.actions[data.index].id;
@@ -108,6 +113,7 @@ Rectangle {
109 compare(image.source, buttonIcon);
114 compare(image.source, buttonIcon);
110 compare(label.text, buttonLabel);
115 compare(label.text, buttonLabel);
116+ timer.changeIcon = data.changeIcon;
111 mouseClick(button);
117 mouseClick(button);
112 compare(spy.count, 1);
118 compare(spy.count, 1);
113 compare(spy.signalArguments[0][1], buttonId);
119 compare(spy.signalArguments[0][1], buttonId);
@@ -119,7 +125,11 @@ Rectangle {
119 tryCompareFunction(function() {
125 tryCompareFunction(function() {
120 var button = findChild(root, "button" + buttonId);
126 var button = findChild(root, "button" + buttonId);
121 var image = findChildsByType(button, "QQuickImage")[0];
127 var image = findChildsByType(button, "QQuickImage")[0];
128+ if (data.changeIcon) {
122− return image.source && image.source.toString().indexOf("UnityLogo") > -1;
129+ return image.source && image.source.toString().indexOf("UnityLogo") > -1;
131+ return image.source && image.source == buttonIcon;
123 }, true);
133 }, true);