~mterry/unity8/power-button-on-lock

« back to all changes in this revision

Viewing changes to tests/qmltests/Stages/tst_SessionContainer.qml

  • Committer: Michael Terry
  • Date: 2014-11-24 15:25:42 UTC
  • mfrom: (1368.1.82 unity8)
  • Revision ID: michael.terry@canonical.com-20141124152542-5cysva8ds3qfula6
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
            tryCompare(sessionSpy, "count", data.count);
186
186
        }
187
187
 
 
188
        function test_childSessionDestructionReturnsFocusToSiblingOrParent() {
 
189
            sessionCheckbox.checked = true;
 
190
            var sessionContainer = sessionContainerLoader.item;
 
191
            compare(sessionContainer.childSessions.count(), 0);
 
192
 
 
193
            sessionContainer.interactive = true;
 
194
 
 
195
            var i;
 
196
            var sessions = [];
 
197
            // 3 sessions should cover all edge cases
 
198
            for(i = 0; i < 3; i++) {
 
199
                var a_session = ApplicationTest.addChildSession(
 
200
                    sessionContainer.session, "gallery"
 
201
                )
 
202
 
 
203
                a_session.createSurface();
 
204
                sessionContainer.session.addChildSession(a_session);
 
205
                compare(sessionContainer.childSessions.count(), i + 1);
 
206
 
 
207
                sessions.push(a_session);
 
208
            }
 
209
 
 
210
            var a_session;
 
211
            while(a_session = sessions.pop()) {
 
212
                a_session.surface.forceActiveFocus();
 
213
                compare(a_session.surface.activeFocus, true);
 
214
 
 
215
                var parentSession = a_session.parentSession;
 
216
                sessionContainer.session.removeChildSession(a_session);
 
217
                compare(a_session.surface.activeFocus, false);
 
218
 
 
219
                compare(parentSession.surface.activeFocus, true);
 
220
            }
 
221
        }
 
222
 
188
223
        function test_nestedChildSessions_data() {
189
224
            return [ { tag: "depth=2", depth: 2 },
190
225
                     { tag: "depth=8", depth: 8 }