on xenial help sign in
Fix 2 failing color-related tests

Approved by: Michał Sawicz

commit5ca186e777ef6ab771dbeba9169d26987f1fdda7 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 13 Sep 2016, 06:51 (10 years ago) parent3472f4d0e8355f
2 files changed+5−4
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+1−1 tests/qmltests/Panel/tst_IndicatorItem.qml+4−3
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+1−1
@@ -409,7 +409,7 @@ Item {
409409 menuData.sensitive = data.enabled;
410410 menuData.icon = data.icon;
411411 menuData.ext = {
412− 'xCanonicalColor': data.colour,
412+ 'xCanonicalColor': data.color,
413413 'xCanonicalTime': data.time.getTime() / 1000 // expected in seconds
414414 };
415415
tests/qmltests/Panel/tst_IndicatorItem.qml+4−3
@@ -190,9 +190,10 @@ Rectangle {
190190
191191 indicatorItem.expanded = true;
192192 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.disabled.backgroundText);
193− tryCompare(findChild(indicatorItem, "leftLabel"), "color", theme.palette.disabled.backgroundText);
194− tryCompare(findChild(indicatorItem, "rightLabel"), "color", theme.palette.disabled.backgroundText);
195− tryCompare(findChild(indicatorItem, "indicatorName"), "color", theme.palette.disabled.backgroundText);
193+ // WORKAROUND for a Qt bug in comparing colors: https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1619281
194+ fuzzyCompare(findChild(indicatorItem, "leftLabel").color, theme.palette.disabled.backgroundText, 0.001);
195+ fuzzyCompare(findChild(indicatorItem, "rightLabel").color, theme.palette.disabled.backgroundText, 0.001);
196+ fuzzyCompare(findChild(indicatorItem, "indicatorName").color, theme.palette.disabled.backgroundText, 0.001);
196197
197198 indicatorItem.selected = true;
198199 tryCompare(findChild(indicatorItem, "icon0"), "color", theme.palette.normal.backgroundText);