on xenial help sign in
make testPhoneStage pass after the modifications required for QtComp
commit81b28c098ab9b75b8c5cdd619cb9d2dc276441d4 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 3 Jul 2014, 19:05 (12 years ago) parent84e8944
3 files changed+6−23
qml/Stages/SpreadDelegate.qml+1−1 tests/mocks/Unity/Application/ApplicationManager.cpp−2 tests/qmltests/Stages/tst_PhoneStage.qml+5−20
qml/Stages/SpreadDelegate.qml+1−1
@@ -41,7 +41,7 @@ Item {
4141 readonly property var surface: model.surface
4242 property bool appHasCreatedASurface: false
4343
44− onSurfaceChanged: { print("SURFACE!!", model.surface)
44+ onSurfaceChanged: {
4545 if (surface) {
4646 if (!appHasCreatedASurface) {
4747 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,
181181 }
182182 add(application);
183183
184− QMetaObject::invokeMethod(this, "focusApplication", Qt::QueuedConnection, Q_ARG(QString, appId));
185−
186184 return application;
187185}
188186
tests/qmltests/Stages/tst_PhoneStage.qml+5−20
@@ -33,7 +33,6 @@ Item {
3333 PhoneStage {
3434 id: phoneStage
3535 anchors { fill: parent; rightMargin: units.gu(30) }
36− shown: true
3736 dragAreaWidth: units.gu(2)
3837 }
3938
@@ -74,11 +73,8 @@ Item {
7473 for (var i = 0; i < count; i++) {
7574 var app = ApplicationManager.startApplication(ApplicationManager.availableApplications()[ApplicationManager.count])
7675 tryCompare(app, "state", ApplicationInfoInterface.Running)
77− // Fixme: Right now there is a timeout in the PhoneStage that displays a white splash
78− // screen rectangle when an app starts. This is because we don't yet have a way of
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)
76+ var spreadView = findChild(phoneStage, "spreadView");
77+ tryCompare(spreadView, "contentX", -spreadView.shift);
8278 waitForRendering(phoneStage)
8379 }
8480 }
@@ -114,8 +110,6 @@ Item {
114110 true /* beginTouch */, true /* endTouch */, units.gu(10), 50);
115111
116112 tryCompare(ApplicationManager, "focusedApplicationId", activeApp.appId)
117−
118− tryCompare(phoneStage, "painting", false);
119113 }
120114
121115 function test_enterSpread_data() {
@@ -165,7 +159,6 @@ Item {
165159 mouseClick(app2, units.gu(1), units.gu(1));
166160 }
167161
168− tryCompare(phoneStage, "painting", false);
169162 tryCompare(ApplicationManager, "focusedApplicationId", newFocusedApp.appId);
170163 }
171164
@@ -212,16 +205,6 @@ Item {
212205 tryCompare(spreadView, "phase", 0);
213206 }
214207
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−
225208 function test_select_data() {
226209 return [
227210 { tag: "0", index: 0 },
@@ -238,9 +221,11 @@ Item {
238221
239222 goToSpread();
240223
224+
241225 phoneStage.select(selectedApp.appId);
242226
243− tryCompare(phoneStage, "painting", false);
227+ tryCompare(spreadView, "contentX", -spreadView.shift);
228+
244229 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
245230 }
246231