@@ -54,6 +54,7 @@ Item {
54 when: scopes.loaded && windowShown
54 when: scopes.loaded && windowShown
56 property Item previewListView: findChild(genericScopeView, "previewListView")
56 property Item previewListView: findChild(genericScopeView, "previewListView")
57+ property Item header: findChild(genericScopeView, "scopePageHeader")
58 function init() {
59 function init() {
59 genericScopeView.scope = scopes.getScope(1)
60 genericScopeView.scope = scopes.getScope(1)
@@ -257,13 +258,33 @@ Item {
257 closePreview();
258 closePreview();
260− function test_haeder_logo() {
261+ function test_header_style_data() {
261− genericScopeView.scope = scopes.getScope(3);
262+ return [
263+ { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" },
264+ { tag: "Foreground", index: 2, foreground: "yellow", background: "", logo: "" },
265+ { tag: "Logo+Background", index: 3, foreground: "grey", background: "gradient:///lightgrey/grey",
266+ logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") },
270+ function test_header_style(data) {
271+ genericScopeView.scope = scopes.getScope(data.index);
263− var image = findChild(genericScopeView, "titleImage");
272+ waitForRendering(genericScopeView);
264− verify(image, "Could not find the title image");
273+ verify(header, "Could not find the header.");
265− compare(image.source, Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg"), "Title image has the wrong source");
275+ var innerHeader = findChild(header, "innerPageHeader");
276+ verify(innerHeader, "Could not find the inner header");
277+ verify(Qt.colorEqual(innerHeader.textColor, data.foreground),
278+ "Foreground color not equal: %1 != %2".arg(innerHeader.textColor).arg(data.foreground));
280+ var background = findChild(header, "headerBackground");
281+ verify(background, "Could not find the background");
282+ compare(background.style, data.background);
284+ var image = findChild(genericScopeView, "titleImage");
285+ if (data.logo == "") expectFail(data.tag, "Title image should not exist.");
286+ verify(image, "Could not find the title image.");
287+ compare(image.source, data.logo, "Title image has the wrong source");