@@ -33,6 +33,12 @@ Rectangle {
3333 when: windowShown
3434
3535 property color color
36+ property var styles: [
37+ {},
38+ { "foreground-color": "red" },
39+ { "foreground-color": "green" },
40+ { "foreground-color": "blue" },
41+ ]
3642
3743 function cleanup() {
3844 testCase.color = "transparent";
@@ -55,5 +61,20 @@ Rectangle {
5561 testCase.color = data.tag;
5662 compare(tool.luminance(testCase.color).toFixed(4), data.luminance.toFixed(4));
5763 }
64+
65+ function test_foreground_data() {
66+ return [
67+ { tag: "default", index: 0, foreground: "grey" },
68+ { tag: "red", index: 1, foreground: "red" },
69+ { tag: "green", index: 2, foreground: "green" },
70+ { tag: "blue", index: 3, foreground: "blue" },
71+ ];
72+ }
73+
74+ function test_foreground(data) {
75+ tool.style = testCase.styles[data.index];
76+ verify(Qt.colorEqual(tool.foreground, data.foreground),
77+ "Foreground color not equal: %1 != %2".arg(tool.foreground).arg(data.foreground));
78+ }
5879 }
5980}