on xenial help sign in
Fix test
74b5e63Josh Arenson
qml/Greeter/WideView.qml+1−6
@@ -141,11 +141,6 @@ FocusScope {
141 model: root.userModel
141 model: root.userModel
142 onResponded: root.responded(response)
142 onResponded: root.responded(response)
143 onSelected: {
143 onSelected: {
144− if (LightDMService.users.mock) {
145− LightDMService.users.mock.currentUsername = currentUser;
146− }
147−
148− loginList.selectedUserIndex = index;
149 root.selected(index)
144 root.selected(index)
150 currentSession = LightDMService.users.data(index, LightDMService.userRoles.SessionRole);
145 currentSession = LightDMService.users.data(index, LightDMService.userRoles.SessionRole);
151 }
146 }
@@ -159,7 +154,7 @@ FocusScope {
159 //enabled: LightDM.Users.mock
154 //enabled: LightDM.Users.mock
160 target: LightDMService.users
155 target: LightDMService.users
161 onModelReset: {
156 onModelReset: {
162− loginList.currentSession = LightDMService.users.data(loginList.selectedUserIndex, LightDMService.userRoles.SessionRole);
157+ loginList.currentSession = LightDMService.users.data(loginList.currentIndex, LightDMService.userRoles.SessionRole);
163 }
158 }
164 }
159 }
165 }
160 }
tests/qmltests/Greeter/tst_WideView.qml+9−4
@@ -412,19 +412,24 @@ StyledItem {
412 }
412 }
413
413
414 function test_changingSessionSticksToUser() {
414 function test_changingSessionSticksToUser() {
415− LightDM.Sessions.mock.sessionMode = "full";
415+ LightDMController.sessionMode = "full";
416+ // For this test to work, a user has to be selected and the
417+ // mock must be made aware of that user
418+ selectUser("has-password")
419+ LightDMController.currentUsername = "has-password"
420+
416 var loginList = findChild(view, "loginList");
421 var loginList = findChild(view, "loginList");
417 var fakeSessionName = "ASessionWillNeverBeCalledThis";
422 var fakeSessionName = "ASessionWillNeverBeCalledThis";
418
423
419 compare(LightDM.Sessions.count > 1, true);
424 compare(LightDM.Sessions.count > 1, true);
420 compare(loginList.currentSession != fakeSessionName, true);
425 compare(loginList.currentSession != fakeSessionName, true);
421
426
422− LightDM.Users.mock.sessionName = fakeSessionName;
427+ LightDMController.sessionName = fakeSessionName;
423 tryCompare(loginList, "currentSession", fakeSessionName);
428 tryCompare(loginList, "currentSession", fakeSessionName);
424
429
425 // Force a model reset
430 // Force a model reset
426− LightDM.Users.mock.userMode = "single";
431+ LightDMController.userMode = "single";
427− LightDM.Users.mock.userMode = "full";
432+ LightDMController.userMode = "full";
428 }
433 }
429
434
430 function test_tease_data() {
435 function test_tease_data() {