on xenial help sign in
test_SessionContainer: stupid compare statements fixed. Using root & child prefixes to clarify things
7827c24Gerry Boland
tests/qmltests/Stages/tst_SessionContainer.qml+11−11
@@ -291,34 +291,34 @@ Rectangle {
291 /* Text orientation changes are propagated to all children immediately */
291 /* Text orientation changes are propagated to all children immediately */
292 function test_orientationPropagatedToChildren(data) {
292 function test_orientationPropagatedToChildren(data) {
293 sessionCheckbox.checked = true;
293 sessionCheckbox.checked = true;
294− var sessionContainer = sessionContainerLoader.item;
294+ var rootSessionContainer = sessionContainerLoader.item;
295− compare(sessionContainer.childSessions.count(), 0);
295+ compare(rootSessionContainer.childSessions.count(), 0);
296
296
297 var i;
297 var i;
298 var sessions = [];
298 var sessions = [];
299 for (i = 0; i < data.count; i++) {
299 for (i = 0; i < data.count; i++) {
300− var session = ApplicationTest.addChildSession(sessionContainer.session,
300+ var session = ApplicationTest.addChildSession(rootSessionContainer.session,
301 "gallery");
301 "gallery");
302 session.createSurface();
302 session.createSurface();
303− sessionContainer.session.addChildSession(session);
303+ rootSessionContainer.session.addChildSession(session);
304
304
305 // Check child SessionContainer has orientation matching the parent
305 // Check child SessionContainer has orientation matching the parent
306− var delegate = findChild(sessionContainer, "childDelegate" + i);
306+ var delegate = findChild(rootSessionContainer, "childDelegate" + i);
307− var childContainer = findChild(delegate, "sessionContainer");
307+ var childSessionContainer = findChild(delegate, "sessionContainer");
308
308
309− tryCompare(sessionContainer, "orientation", sessionContainer.orientation);
309+ tryCompare(rootSessionContainer, "orientation", childSessionContainer.orientation);
310
310
311 sessions.push(session);
311 sessions.push(session);
312 }
312 }
313
313
314 // Change orientation and verify all children updated
314 // Change orientation and verify all children updated
315− sessionContainer.orientation = Qt.LandscapeOrientation;
315+ rootSessionContainer.orientation = Qt.LandscapeOrientation;
316
316
317 for (i = 0; i < data.count; i++) {
317 for (i = 0; i < data.count; i++) {
318− var delegate = findChild(sessionContainer, "childDelegate" + i);
318+ var delegate = findChild(rootSessionContainer, "childDelegate" + i);
319− var childContainer = findChild(delegate, "sessionContainer");
319+ var childSessionContainer = findChild(delegate, "sessionContainer");
320
320
321− tryCompare(sessionContainer, "orientation", sessionContainer.orientation);
321+ tryCompare(rootSessionContainer, "orientation", childSessionContainer.orientation);
322 }
322 }
323
323
324 // Clean up
324 // Clean up