on xenial help sign in
Benchmark various card models
commitd482a3e61d7d1ddf7eb04a0e7a95754542e759cc authorAlbert Astals <albert.astals@canonical.com> dateTue 1 Apr 2014, 12:43 (13 years ago) parent2de1a6f
1 file changed+26−9
tests/qmltests/Dash/tst_CardBenchmark.qml+26−9
tests/qmltests/Dash/tst_CardBenchmark.qml+26−9
@@ -36,17 +36,18 @@ Rectangle {
3636 "summary": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
3737 }'
3838
39−// property string cardModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot", "summary": "summary" } }'
40−// property string cardModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot" } }'
41− property string cardModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle" } }'
42−// property string cardModel: '{ "components": { "title": "title", "art": "art" } }'
43−// property string cardModel: '{ "components": { "art": "art" } }'
44−// property string cardModel: '{ "components": { "title": "title" } }'
39+ property string currentModel
40+ property string cardTitleArtSubtitleMascotSummaryModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot", "summary": "summary" } }'
41+ property string cardTitleArtSubtitleMascotModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle", "mascot": "mascot" } }'
42+ property string cardTitleArtSubtitleModel: '{ "components": { "title": "title", "art": "art", "subtitle": "subtitle" } }'
43+ property string cardTitleArtModel: '{ "components": { "title": "title", "art": "art" } }'
44+ property string cardArtModel: '{ "components": { "art": "art" } }'
45+ property string cardTitleModel: '{ "components": { "title": "title" } }'
4546
4647 CardTool {
4748 id: cardTool
48− template: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(cardModel))['template'];
49− components: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(cardModel))['components'];
49+ template: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(currentModel))['template'];
50+ components: Helpers.update(JSON.parse(Helpers.defaultLayout), JSON.parse(currentModel))['components'];
5051 viewWidth: units.gu(48)
5152 }
5253
@@ -69,7 +70,23 @@ Rectangle {
6970
7071 when: windowShown
7172
72− function benchmark_time() {
73+ function benchmark_time_data() {
74+ return [
75+ { tag: "cardTitleArtSubtitleMascotSummaryModel", model: cardTitleArtSubtitleMascotSummaryModel },
76+ { tag: "cardTitleArtSubtitleMascotModel", model: cardTitleArtSubtitleMascotModel },
77+ { tag: "cardTitleArtSubtitleModel", model: cardTitleArtSubtitleModel },
78+ { tag: "cardTitleArtModel", model: cardTitleArtModel },
79+ { tag: "cardArtModel", model: cardArtModel },
80+ { tag: "cardTitleModel", model: cardTitleModel },
81+ ];
82+ }
83+
84+ function init() {
85+ wait(1);
86+ }
87+
88+ function benchmark_time(data) {
89+ currentModel = data.model
7390 cardRepeater.model = 1
7491 cardRepeater.model = 0
7592 }