on xenial help sign in
Set icon search directory
9282f8dMichael Terry
tests/qmltests/Greeter/tst_WideView.qml+4−7
@@ -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];
366 }
367 }
367
368
368 function cleanup() {
369 function cleanup() {
@@ -420,9 +421,6 @@ StyledItem {
420 }
421 }
421
422
422 function test_sessionIconsAreValid() {
423 function test_sessionIconsAreValid() {
423− var originalDirectories = LightDM.Sessions.iconSearchDirectories
424− LightDM.Sessions.iconSearchDirectories = [testIconDirectory]
425−
426 selectUser("has-password");
424 selectUser("has-password");
427
425
428 // Test the login list icon is valid
426 // Test the login list icon is valid
@@ -442,8 +440,7 @@ StyledItem {
442
440
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;
447
444
448 selectUser("has-password");
445 selectUser("has-password");
449
446
@@ -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 break;
460 break;
465 }
461 }
466 }
462 }
467
463
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);
470 }
467 }