@@ -252,6 +252,7 @@ Rectangle {
252252 { tag: "Large", width: units.gu(38), index: 2 },
253253 { tag: "Wide", height: units.gu(19), size: "large", index: 3 },
254254 { tag: "Fit", height: units.gu(38), size: "large", width: units.gu(19), index: 4 },
255+ { tag: "Horizontal", height: function() { return header.height }, index: 5},
255256 ]
256257 }
257258
@@ -269,11 +270,13 @@ Rectangle {
269270 }
270271
271272 if (data.hasOwnProperty("width")) {
272− tryCompare(art, "width", data.width);
273+ var width = typeof data.width === "function" ? data.width() : data.width;
274+ tryCompare(art, "width", width);
273275 }
274276
275277 if (data.hasOwnProperty("height")) {
276− tryCompare(art, "height", data.height);
278+ var height = typeof data.height === "function" ? data.height() : data.height;
279+ tryCompare(art, "height", height);
277280 }
278281
279282 if (data.hasOwnProperty("fill")) {
@@ -281,54 +284,33 @@ Rectangle {
281284 }
282285 }
283286
284− function test_art_image_size_data() {
285− return [
286− { tag: "CardVerticalMedium", width: header.width, index: 0 },
287− { tag: "CardHorizontalMedium", height: header.height, index: 5 },
288− ]
289− }
290−
291− function test_art_image_size(data) {
292− selector.selectedIndex = data.index;
293−
294− if (data.hasOwnProperty("width")) {
295− tryCompare(artImage, "width", data.width);
296− }
297−
298− if (data.hasOwnProperty("height")) {
299− tryCompare(artImage, "height", data.height);
300− }
301− }
302−
303287 function test_art_layout_data() {
304288 return [
305− { tag: "CardVertical", headerX: 0, index: 0 },
306− { tag: "CardHorizontal", headerX: artImage.width, index: 5 },
289+ { tag: "Vertical", left: function() { return 0 }, index: 0},
290+ { tag: "Horizontal", left: function() { return art.width }, index: 5 }
307291 ];
308292 }
309293
310294 function test_art_layout(data) {
311295 selector.selectedIndex = data.index;
312296
313− if (data.hasOwnProperty("headerX")) {
314− tryCompare(testCase.header.x, data.headerLeft, data.value);
315− }
297+ tryCompare(testCase.header, "x", data.left());
316298 }
317299
318300 function test_header_layout_data() {
319301 return [
320− { tag: "CardVertical", top: art.y + art.height, left: card.x, index: 0 },
321− { tag: "CardHorizontal", top: art.x, left: art.x + art.width, index: 5 }
302+ { tag: "Vertical", top: function() { return art.y + art.height },
303+ left: function() { return art.x }, index: 0 },
304+ { tag: "Horizontal", top: function() { return art.y },
305+ left: function() { return art.x + art.width }, index: 5 }
322306 ]
323307 }
324308
325309 function test_header_layout(data) {
326310 selector.selectedIndex = data.index;
327311
328− tryCompare(testCase.header, "y", data.top);
329−// XXX karni: Can't get this to pass:
330−// tryCompare(testCase.header, "x", data.left);
312+ tryCompare(testCase.header, "y", data.top());
313+ tryCompare(testCase.header, "x", data.left());
331314 }
332−
333315 }
334316}