on xenial help sign in
test fixes for removal of content activator
cfa89fbNick Dedekind
tests/mocks/Unity/Indicators/FakeMenuPage.qml−10
@@ -19,16 +19,6 @@ import QtQuick 2.0
19Flickable {
19Flickable {
20 objectName: "fakeMenuPlugin"
20 objectName: "fakeMenuPlugin"
21 // Make it compatible with the PluginItem interface
21 // Make it compatible with the PluginItem interface
22− function start() {
23− if (shell != undefined && shell.indicator_status != undefined) {
24− shell.indicator_status[objectName].started = true;
25− }
26− }
27− function stop() {
28− if (shell != undefined && shell.indicator_status != undefined) {
29− shell.indicator_status[objectName].started = false;
30− }
31− }
32 function reset() {
22 function reset() {
33 if (shell != undefined && shell.indicator_status != undefined) {
23 if (shell != undefined && shell.indicator_status != undefined) {
34 shell.indicator_status[objectName].reset++;
24 shell.indicator_status[objectName].reset++;
tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml+21−30
@@ -90,16 +90,13 @@ Item {
90 factory.menuData = menuData;
90 factory.menuData = menuData;
91 timeFormatter.time = data.time.getTime()/1000;
91 timeFormatter.time = data.time.getTime()/1000;
92
92
93− var loader = findChild(factory, "loader");
94− verify(loader !== undefined);
95−
96− tryCompare(loader.item, "objectName", "simpleTextMessage");
93+ tryCompare(factory.item, "objectName", "simpleTextMessage");
97− compare(loader.item.title, data.title, "Title does not match data");
94+ compare(factory.item.title, data.title, "Title does not match data");
98− compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
95+ compare(factory.item.time, timeFormatter.timeString, "Time does not match data");
99− compare(loader.item.body, data.body, "Message does not match data");
96+ compare(factory.item.body, data.body, "Message does not match data");
100− compare(loader.item.avatar, data.avatar, "Avatar does not match data");
97+ compare(factory.item.avatar, data.avatar, "Avatar does not match data");
101− compare(loader.item.icon, data.icon, "App icon does not match data");
98+ compare(factory.item.icon, data.icon, "App icon does not match data");
102− compare(loader.item.enabled, data.enabled, "Enabled does not match data");
99+ compare(factory.item.enabled, data.enabled, "Enabled does not match data");
103 }
100 }
104
101
105 function test_create_textmessage_data() {
102 function test_create_textmessage_data() {
@@ -128,16 +125,13 @@ Item {
128 factory.menuData = menuData;
125 factory.menuData = menuData;
129 timeFormatter.time = data.time.getTime()/1000;
126 timeFormatter.time = data.time.getTime()/1000;
130
127
131− var loader = findChild(factory, "loader");
132− verify(loader !== undefined);
133−
134− tryCompare(loader.item, "objectName", "textMessage");
128+ tryCompare(factory.item, "objectName", "textMessage");
135− compare(loader.item.title, data.title, "Title does not match data");
129+ compare(factory.item.title, data.title, "Title does not match data");
136− compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
130+ compare(factory.item.time, timeFormatter.timeString, "Time does not match data");
137− compare(loader.item.body, data.body, "Message does not match data");
131+ compare(factory.item.body, data.body, "Message does not match data");
138− compare(loader.item.avatar, data.avatar, "Avatar does not match data");
132+ compare(factory.item.avatar, data.avatar, "Avatar does not match data");
139− compare(loader.item.icon, data.icon, "App icon does not match data");
133+ compare(factory.item.icon, data.icon, "App icon does not match data");
140− compare(loader.item.enabled, data.enabled, "Enabled does not match data");
134+ compare(factory.item.enabled, data.enabled, "Enabled does not match data");
141 }
135 }
142
136
143
137
@@ -170,16 +164,13 @@ Item {
170 factory.menuData = menuData;
164 factory.menuData = menuData;
171 timeFormatter.time = data.time.getTime()/1000;
165 timeFormatter.time = data.time.getTime()/1000;
172
166
173− var loader = findChild(factory, "loader");
174− verify(loader !== undefined);
175−
176− tryCompare(loader.item, "objectName", "snapDecision");
167+ tryCompare(factory.item, "objectName", "snapDecision");
177− compare(loader.item.title, data.title, "Title does not match data");
168+ compare(factory.item.title, data.title, "Title does not match data");
178− compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
169+ compare(factory.item.time, timeFormatter.timeString, "Time does not match data");
179− compare(loader.item.body, data.body, "Message does not match data");
170+ compare(factory.item.body, data.body, "Message does not match data");
180− compare(loader.item.avatar, data.avatar, "Avatar does not match data");
171+ compare(factory.item.avatar, data.avatar, "Avatar does not match data");
181− compare(loader.item.icon, data.icon, "App icon does not match data");
172+ compare(factory.item.icon, data.icon, "App icon does not match data");
182− compare(loader.item.enabled, data.enabled, "Enabled does not match data");
173+ compare(factory.item.enabled, data.enabled, "Enabled does not match data");
183 }
174 }
184
175
185 }
176 }
tests/qmltests/Panel/tst_MenuContent.qml−42
@@ -47,7 +47,6 @@ Item {
47 MenuContent {
47 MenuContent {
48 id: menuContent
48 id: menuContent
49 indicatorsModel: indicatorsModel
49 indicatorsModel: indicatorsModel
50− contentReleaseInterval: 50
51 height: parent.height - 50
50 height: parent.height - 50
52 }
51 }
53
52
@@ -114,12 +113,6 @@ Item {
114 name: "MenuContentTest"
113 name: "MenuContentTest"
115 when: windowShown
114 when: windowShown
116
115
117− function init() {
118− if (menuContent.__contentActive)
119− menuContent.releaseContent();
120− tryCompare(menuContent, "__contentActive", false);
121− }
122−
123 // Check that the correct menus are displayed for the requested item.
116 // Check that the correct menus are displayed for the requested item.
124 function test_show_menu() {
117 function test_show_menu() {
125 var menuCount = indicatorsModel.count;
118 var menuCount = indicatorsModel.count;
@@ -139,41 +132,6 @@ Item {
139 }
132 }
140 }
133 }
141
134
142− // Calling activateContent should call start on all menus
143− function test_activate_content() {
144− var menuCount = indicatorsModel.count;
145− verify(menuCount > 0, "Menu count should be greater than zero");
146−
147− // Ensure all the menus are stopped first
148− menuContent.__contentActive = false;
149− for (var i = 0; i < menuCount; i++) {
150− tryCompare(indicator_status[get_test_menu_objecName(i)], "started", false);
151− }
152−
153− // activate content the content to call stop.
154− menuContent.activateContent();
155− for (var i = 0; i < menuCount; i++) {
156− tryCompare(indicator_status[get_test_menu_objecName(i)], "started", true);
157− }
158− }
159−
160− // Calling activateContent should call stop on all menus.
161− function test_release_content() {
162− var menuCount = indicatorsModel.count;
163− verify(menuCount > 0, "Menu count should be greater than zero");
164−
165− // Ensure all the menus are started first
166− menuContent.__contentActive = true;
167− for (var i = 0; i < menuCount; i++) {
168− tryCompare(indicator_status[get_test_menu_objecName(i)], "started", true);
169− }
170− // release the content to call stop.
171− menuContent.releaseContent();
172− for (var i = 0; i < menuCount; i++) {
173− tryCompare(indicator_status[get_test_menu_objecName(i)], "started", false);
174− }
175− }
176−
177 // Tests QTBUG-30632 - asynchronous loader crashes when changing index quickly.
135 // Tests QTBUG-30632 - asynchronous loader crashes when changing index quickly.
178 function test_multi_activate() {
136 function test_multi_activate() {
179 var menuCount = indicatorsModel.count;
137 var menuCount = indicatorsModel.count;