@@ -336,7 +336,7 @@ StyledItem {
336 respondedSpy.clear();
336 respondedSpy.clear();
337 teaseSpy.clear();
337 teaseSpy.clear();
338 emergencySpy.clear();
338 emergencySpy.clear();
339− LightDMController.sessionMode = "full";
339+ LightDMController.reset();
340 LightDM.Sessions.iconSearchDirectories = [testIconDirectory];
340 LightDM.Sessions.iconSearchDirectories = [testIconDirectory];
@@ -394,34 +394,16 @@ StyledItem {
396 function test_changingSessionSticksToUser() {
396 function test_changingSessionSticksToUser() {
397− LightDMController.sessionMode = "full";
399 var loginList = findChild(view, "loginList");
397 var loginList = findChild(view, "loginList");
400− var fakeSession1 = "ASessionWillNeverBeCalledThis";
401− var fakeSession2 = "ASessionWillAlsoNeverBeCalledThis";
403− // For this test to work, a user has to be selected and the
404− // mock must be made aware of that user
405− selectUser("has-password")
406− LightDMController.currentUsername = "has-password"
407− compare(LightDM.Sessions.count > 1, true);
408− compare(loginList.currentSession != fakeSession1, true);
409− LightDMController.sessionName = fakeSession1;
411− selectUser("has-pin")
412− LightDMController.currentUsername = "has-pin"
413− compare(loginList.currentSession != fakeSession2, true);
414− LightDMController.sessionName = fakeSession2;
416− selectUser("has-password")
399+ selectUser("invalid-session");
417− tryCompare(loginList, "currentSession", fakeSession1);
400+ tryCompare(loginList, "currentSession", "invalid");
419− selectUser("has-pin")
402+ selectUser("has-password");
420− tryCompare(loginList, "currentSession", fakeSession2);
403+ tryCompare(loginList, "currentSession", "ubuntu");
422− // Force a model reset
405+ selectUser("invalid-session")
423− LightDMController.userMode = "single";
406+ tryCompare(loginList, "currentSession", "invalid");
424− LightDMController.userMode = "full";
427 function test_tease_data() {
409 function test_tease_data() {
@@ -494,9 +476,6 @@ StyledItem {
496 function test_sessionIconNotShownWithActiveUser() {
478 function test_sessionIconNotShownWithActiveUser() {
497− LightDMController.sessionMode = "full";
498− compare(LightDM.Sessions.count > 1, true);
500 selectUser("active");
479 selectUser("active");
502 var sessionChooserButton = findChild(view, "sessionChooserButton");
481 var sessionChooserButton = findChild(view, "sessionChooserButton");
@@ -504,9 +483,6 @@ StyledItem {
506 function test_sessionIconShownWithMultipleSessions() {
485 function test_sessionIconShownWithMultipleSessions() {
507− LightDMController.sessionMode = "full";
508− compare(LightDM.Sessions.count > 1, true);
510 selectUser("has-password");
486 selectUser("has-password");
512 var sessionChooserButton = findChild(view, "sessionChooserButton");
488 var sessionChooserButton = findChild(view, "sessionChooserButton");