on xenial help sign in
Fix test
commit74b5e63ffd6709254ea621ac0cdd6f1db5a28855 authorJosh Arenson <joshua.arenson@canonical.com> dateFri 6 Jan 2017, 16:20 (10 years ago) parent58a71b0
2 files changed+10−10
qml/Greeter/WideView.qml+1−6 tests/qmltests/Greeter/tst_WideView.qml+9−4
qml/Greeter/WideView.qml+1−6
@@ -141,11 +141,6 @@ FocusScope {
141141 model: root.userModel
142142 onResponded: root.responded(response)
143143 onSelected: {
144− if (LightDMService.users.mock) {
145− LightDMService.users.mock.currentUsername = currentUser;
146− }
147−
148− loginList.selectedUserIndex = index;
149144 root.selected(index)
150145 currentSession = LightDMService.users.data(index, LightDMService.userRoles.SessionRole);
151146 }
@@ -159,7 +154,7 @@ FocusScope {
159154 //enabled: LightDM.Users.mock
160155 target: LightDMService.users
161156 onModelReset: {
162− loginList.currentSession = LightDMService.users.data(loginList.selectedUserIndex, LightDMService.userRoles.SessionRole);
157+ loginList.currentSession = LightDMService.users.data(loginList.currentIndex, LightDMService.userRoles.SessionRole);
163158 }
164159 }
165160 }
tests/qmltests/Greeter/tst_WideView.qml+9−4
@@ -412,19 +412,24 @@ StyledItem {
412412 }
413413
414414 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+
416421 var loginList = findChild(view, "loginList");
417422 var fakeSessionName = "ASessionWillNeverBeCalledThis";
418423
419424 compare(LightDM.Sessions.count > 1, true);
420425 compare(loginList.currentSession != fakeSessionName, true);
421426
422− LightDM.Users.mock.sessionName = fakeSessionName;
427+ LightDMController.sessionName = fakeSessionName;
423428 tryCompare(loginList, "currentSession", fakeSessionName);
424429
425430 // Force a model reset
426− LightDM.Users.mock.userMode = "single";
427− LightDM.Users.mock.userMode = "full";
431+ LightDMController.userMode = "single";
432+ LightDMController.userMode = "full";
428433 }
429434
430435 function test_tease_data() {