@@ -413,19 +413,29 @@ StyledItem {
414 function test_changingSessionSticksToUser() {
414 function test_changingSessionSticksToUser() {
415 LightDMController.sessionMode = "full";
415 LightDMController.sessionMode = "full";
417+ var loginList = findChild(view, "loginList");
418+ var fakeSession1 = "ASessionWillNeverBeCalledThis";
419+ var fakeSession2 = "ASessionWillAlsoNeverBeCalledThis";
416 // For this test to work, a user has to be selected and the
421 // For this test to work, a user has to be selected and the
417 // mock must be made aware of that user
422 // mock must be made aware of that user
418 selectUser("has-password")
423 selectUser("has-password")
419 LightDMController.currentUsername = "has-password"
424 LightDMController.currentUsername = "has-password"
425+ compare(LightDM.Sessions.count > 1, true);
426+ compare(loginList.currentSession != fakeSession1, true);
427+ LightDMController.sessionName = fakeSession1;
421− var loginList = findChild(view, "loginList");
429+ selectUser("has-pin")
422− var fakeSessionName = "ASessionWillNeverBeCalledThis";
430+ LightDMController.currentUsername = "has-pin"
431+ compare(loginList.currentSession != fakeSession2, true);
432+ LightDMController.sessionName = fakeSession2;
424− compare(LightDM.Sessions.count > 1, true);
434+ selectUser("has-password")
425− compare(loginList.currentSession != fakeSessionName, true);
435+ tryCompare(loginList, "currentSession", fakeSession1);
427− LightDMController.sessionName = fakeSessionName;
437+ selectUser("has-pin")
428− tryCompare(loginList, "currentSession", fakeSessionName);
438+ tryCompare(loginList, "currentSession", fakeSession2);
430 // Force a model reset
440 // Force a model reset
431 LightDMController.userMode = "single";
441 LightDMController.userMode = "single";