@@ -363,6 +363,7 @@ StyledItem {
363 teaseSpy.clear();
363 teaseSpy.clear();
364 emergencySpy.clear();
364 emergencySpy.clear();
365 LightDM.Sessions.mock.sessionMode = "full";
365 LightDM.Sessions.mock.sessionMode = "full";
366+ LightDM.Sessions.iconSearchDirectories = [testIconDirectory];
368 function cleanup() {
369 function cleanup() {
@@ -420,9 +421,6 @@ StyledItem {
422 function test_sessionIconsAreValid() {
423 function test_sessionIconsAreValid() {
423− var originalDirectories = LightDM.Sessions.iconSearchDirectories
424− LightDM.Sessions.iconSearchDirectories = [testIconDirectory]
426 selectUser("has-password");
424 selectUser("has-password");
428 // Test the login list icon is valid
426 // Test the login list icon is valid
@@ -442,8 +440,7 @@ StyledItem {
443 function test_choosingNewSessionChangesLoginListIcon() {
441 function test_choosingNewSessionChangesLoginListIcon() {
444 // Ensure the default session is selected (Ubuntu)
442 // Ensure the default session is selected (Ubuntu)
445− loader.active = false;
443+ cleanup();
446− loader.active = true;
448 selectUser("has-password");
445 selectUser("has-password");
@@ -457,14 +454,14 @@ StyledItem {
457 var currentDelegate = findChild(view, delegateName);
454 var currentDelegate = findChild(view, delegateName);
458 var sessionKey = LightDM.Sessions.data(i,LightDM.SessionRoles.KeyRole);
455 var sessionKey = LightDM.Sessions.data(i,LightDM.SessionRoles.KeyRole);
459 if (sessionKey === "gnome-classic") {
456 if (sessionKey === "gnome-classic") {
457+ waitForRendering(currentDelegate);
460 tap(currentDelegate);
458 tap(currentDelegate);
461− var sessionChooserButton = findChild(view, "sessionChooserButton");
462 waitForRendering(sessionChooserButton);
459 waitForRendering(sessionChooserButton);
463− var icon = String(sessionChooserButton.icon);
464+ icon = String(sessionChooserButton.icon);
468 compare(icon.indexOf("gnome") > -1, true,
465 compare(icon.indexOf("gnome") > -1, true,
469 "Expected icon to contain gnome but it was " + icon);
466 "Expected icon to contain gnome but it was " + icon);