on xenial help sign in
make testPhoneStage pass after the modifications required for QtComp
81b28c0Michael Zanetti
qml/Stages/SpreadDelegate.qml+1−1
@@ -41,7 +41,7 @@ Item {
41 readonly property var surface: model.surface
41 readonly property var surface: model.surface
42 property bool appHasCreatedASurface: false
42 property bool appHasCreatedASurface: false
43
43
44− onSurfaceChanged: { print("SURFACE!!", model.surface)
44+ onSurfaceChanged: {
45 if (surface) {
45 if (surface) {
46 if (!appHasCreatedASurface) {
46 if (!appHasCreatedASurface) {
47 surface.visible = false; // hide until splash screen removed
47 surface.visible = false; // hide until splash screen removed
tests/mocks/Unity/Application/ApplicationManager.cpp−2
@@ -181,8 +181,6 @@ ApplicationInfo* ApplicationManager::startApplication(const QString &appId,
181 }
181 }
182 add(application);
182 add(application);
183
183
184− QMetaObject::invokeMethod(this, "focusApplication", Qt::QueuedConnection, Q_ARG(QString, appId));
185−
186 return application;
184 return application;
187}
185}
188
186
tests/qmltests/Stages/tst_PhoneStage.qml+5−20
@@ -33,7 +33,6 @@ Item {
33 PhoneStage {
33 PhoneStage {
34 id: phoneStage
34 id: phoneStage
35 anchors { fill: parent; rightMargin: units.gu(30) }
35 anchors { fill: parent; rightMargin: units.gu(30) }
36− shown: true
37 dragAreaWidth: units.gu(2)
36 dragAreaWidth: units.gu(2)
38 }
37 }
39
38
@@ -74,11 +73,8 @@ Item {
74 for (var i = 0; i < count; i++) {
73 for (var i = 0; i < count; i++) {
75 var app = ApplicationManager.startApplication(ApplicationManager.availableApplications()[ApplicationManager.count])
74 var app = ApplicationManager.startApplication(ApplicationManager.availableApplications()[ApplicationManager.count])
76 tryCompare(app, "state", ApplicationInfoInterface.Running)
75 tryCompare(app, "state", ApplicationInfoInterface.Running)
77− // Fixme: Right now there is a timeout in the PhoneStage that displays a white splash
76+ var spreadView = findChild(phoneStage, "spreadView");
78− // screen rectangle when an app starts. This is because we don't yet have a way of
77+ tryCompare(spreadView, "contentX", -spreadView.shift);
79− // knowing when an app has finished launching. That workaround and this wait() should
80− // go away at some point and the app's state only changing to Running when ready for real.
81−// wait(1000)
82 waitForRendering(phoneStage)
78 waitForRendering(phoneStage)
83 }
79 }
84 }
80 }
@@ -114,8 +110,6 @@ Item {
114 true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
110 true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
115
111
116 tryCompare(ApplicationManager, "focusedApplicationId", activeApp.appId)
112 tryCompare(ApplicationManager, "focusedApplicationId", activeApp.appId)
117−
118− tryCompare(phoneStage, "painting", false);
119 }
113 }
120
114
121 function test_enterSpread_data() {
115 function test_enterSpread_data() {
@@ -165,7 +159,6 @@ Item {
165 mouseClick(app2, units.gu(1), units.gu(1));
159 mouseClick(app2, units.gu(1), units.gu(1));
166 }
160 }
167
161
168− tryCompare(phoneStage, "painting", false);
169 tryCompare(ApplicationManager, "focusedApplicationId", newFocusedApp.appId);
162 tryCompare(ApplicationManager, "focusedApplicationId", newFocusedApp.appId);
170 }
163 }
171
164
@@ -212,16 +205,6 @@ Item {
212 tryCompare(spreadView, "phase", 0);
205 tryCompare(spreadView, "phase", 0);
213 }
206 }
214
207
215− function test_animateAppStartup() {
216− compare(phoneStage.painting, false);
217− addApps(2);
218− tryCompare(phoneStage, "painting", true);
219− tryCompare(phoneStage, "painting", false);
220− addApps(1);
221− tryCompare(phoneStage, "painting", true);
222− tryCompare(phoneStage, "painting", false);
223− }
224−
225 function test_select_data() {
208 function test_select_data() {
226 return [
209 return [
227 { tag: "0", index: 0 },
210 { tag: "0", index: 0 },
@@ -238,9 +221,11 @@ Item {
238
221
239 goToSpread();
222 goToSpread();
240
223
224+
241 phoneStage.select(selectedApp.appId);
225 phoneStage.select(selectedApp.appId);
242
226
243− tryCompare(phoneStage, "painting", false);
227+ tryCompare(spreadView, "contentX", -spreadView.shift);
228+
244 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
229 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
245 }
230 }
246
231