@@ -58,6 +58,7 @@ Item {
58 when: scopes.loaded && windowShown
58 when: scopes.loaded && windowShown
60 property Item previewListView: findChild(genericScopeView, "previewListView")
60 property Item previewListView: findChild(genericScopeView, "previewListView")
61+ property Item header: findChild(genericScopeView, "scopePageHeader")
62 function init() {
63 function init() {
63 genericScopeView.scope = scopes.getScope(1)
64 genericScopeView.scope = scopes.getScope(1)
@@ -324,13 +325,33 @@ Item {
324 closePreview();
325 closePreview();
327− function test_header_logo() {
328+ function test_header_style_data() {
328− genericScopeView.scope = scopes.getScope(3);
329+ return [
330+ { tag: "Default", index: 0, foreground: "grey", background: "", logo: "" },
331+ { tag: "Foreground", index: 2, foreground: "yellow", background: "", logo: "" },
332+ { tag: "Logo+Background", index: 3, foreground: "grey", background: "gradient:///lightgrey/grey",
333+ logo: Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg") },
330− var image = findChild(genericScopeView, "titleImage");
337+ function test_header_style(data) {
338+ genericScopeView.scope = scopes.getScope(data.index);
339+ waitForRendering(genericScopeView);
340+ verify(header, "Could not find the header.");
342+ var innerHeader = findChild(header, "innerPageHeader");
331− verify(image, "Could not find the title image");
343+ verify(innerHeader, "Could not find the inner header");
332− compare(image.source, Qt.resolvedUrl("../Components/tst_PageHeader/logo-ubuntu-orange.svg"), "Title image has the wrong source");
344+ verify(Qt.colorEqual(innerHeader.textColor, data.foreground),
345+ "Foreground color not equal: %1 != %2".arg(innerHeader.textColor).arg(data.foreground));
347+ var background = findChild(header, "headerBackground");
348+ verify(background, "Could not find the background");
349+ compare(background.style, data.background);
351+ var image = findChild(genericScopeView, "titleImage");
352+ if (data.logo == "") expectFail(data.tag, "Title image should not exist.");
353+ verify(image, "Could not find the title image.");
354+ compare(image.source, data.logo, "Title image has the wrong source");