@@ -33,6 +33,12 @@ Rectangle {
33 when: windowShown
33 when: windowShown
35 property color color
35 property color color
36+ property var styles: [
38+ { "foreground-color": "red" },
39+ { "foreground-color": "green" },
40+ { "foreground-color": "blue" },
37 function cleanup() {
43 function cleanup() {
38 testCase.color = "transparent";
44 testCase.color = "transparent";
@@ -55,5 +61,20 @@ Rectangle {
55 testCase.color = data.tag;
61 testCase.color = data.tag;
56 compare(tool.luminance(testCase.color).toFixed(4), data.luminance.toFixed(4));
62 compare(tool.luminance(testCase.color).toFixed(4), data.luminance.toFixed(4));
65+ function test_foreground_data() {
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" },
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));