@@ -53,12 +53,12 @@ Rectangle {
53 name: "PreviewHeaderTest"
53 name: "PreviewHeaderTest"
54 when: windowShown
54 when: windowShown
56− property Item mascot: findChild(previewHeader, "mascotShape")
56+ property Item mascotShapeLoader: findChild(previewHeader, "mascotShapeLoader")
57 property Item outerRow: findChild(previewHeader, "outerRow")
57 property Item outerRow: findChild(previewHeader, "outerRow")
58 property Item column: findChild(previewHeader, "column")
58 property Item column: findChild(previewHeader, "column")
60 function initTestCase() {
60 function initTestCase() {
61− verify(typeof testCase.mascot === "object", "Couldn't find mascot object.");
61+ verify(typeof testCase.mascotShapeLoader === "object", "Couldn't find mascot loader object.");
62 verify(typeof testCase.outerRow === "object", "Couldn't find outerRow object.");
62 verify(typeof testCase.outerRow === "object", "Couldn't find outerRow object.");
63 verify(typeof testCase.column === "object", "Couldn't find column object.");
63 verify(typeof testCase.column === "object", "Couldn't find column object.");
@@ -70,9 +70,9 @@ Rectangle {
71 function test_mascot_data() {
71 function test_mascot_data() {
73− { tag: "Empty", source: "", visible: false },
73+ { tag: "Empty", source: "", loaderVisible: false, visible: false },
74− { tag: "Invalid", source: "bad_path", visible: false },
74+ { tag: "Invalid", source: "bad_path", loaderVisible: true, visible: false },
75− { tag: "Valid", source: "../graphics/play_button.png", visible: true },
75+ { tag: "Valid", source: "../graphics/play_button.png", loaderVisible: true, visible: true },
@@ -80,12 +80,17 @@ Rectangle {
80 headerjson.mascot = data.source;
80 headerjson.mascot = data.source;
81 previewHeader.widgetData = headerjson;
81 previewHeader.widgetData = headerjson;
83+ tryCompare(testCase.mascotShapeLoader, "visible", data.loaderVisible);
84+ if (data.loaderVisible) {
85+ tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
86+ var mascot = findChild(previewHeader, "mascotShape")
83− tryCompare(testCase.mascot, "visible", data.visible);
87+ tryCompare(mascot, "visible", data.visible);
86 function test_dimensions_data() {
91 function test_dimensions_data() {
88− { tag: "Column width with mascot", object: column, width: previewHeader.width - mascot.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
93+ { tag: "Column width with mascot", object: column, width: previewHeader.width - mascotShapeLoader.width - outerRow.margins * 3, mascot: "artwork/avatar.png" },
89 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },
94 { tag: "Header height", object: previewHeader, height: function() { return outerRow.height + outerRow.margins * 2 } },