on xenial help sign in
Back out greeter changing profile -- we don't have proper settings support for that yet
commitd5601791d5bb90e4178f98de763e63b59202b3c2 authorMichael Terry <michael.terry@canonical.com> dateFri 6 Feb 2015, 16:12 (12 years ago) parentd0b8547
3 files changed+32−13
qml/Shell.qml+1−1 tests/qmltests/tst_Shell.qml+24−7 tests/qmltests/tst_ShellWithPin.qml+7−5
qml/Shell.qml+1−1
@@ -751,7 +751,7 @@ Item {
751751
752752 indicatorsModel: Indicators.IndicatorsModel {
753753 // TODO: This should be sourced by device type (e.g. "desktop", "tablet", "phone"...)
754− profile: shell.locked ? (indicatorProfile + "_greeter") : indicatorProfile
754+ profile: indicatorProfile
755755 Component.onCompleted: load()
756756 }
757757 }
tests/qmltests/tst_Shell.qml+24−7
@@ -25,6 +25,7 @@ import Ubuntu.Components 1.1
2525import Ubuntu.Telephony 0.1 as Telephony
2626import Unity.Application 0.1
2727import Unity.Connectivity 0.1
28+import Unity.Indicators 0.1
2829import Unity.Notifications 1.0
2930import Unity.Test 0.1 as UT
3031import Powerd 0.1
@@ -169,6 +170,7 @@ Item {
169170
170171 function init() {
171172 tryCompare(shell, "enabled", true); // enabled by greeter when ready
173+ shell.indicatorProfile = "phone";
172174
173175 swipeAwayGreeter();
174176
@@ -547,15 +549,30 @@ Item {
547549 }
548550
549551 function test_greeterDoesNotChangeIndicatorProfile() {
550− var visibleIndicators = findChild(shell, "visibleIndicators");
551− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
552+ var panel = findChild(shell, "panel");
553+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
552554
553− var greeter = findChild(shell, "greeter");
554− greeter.show();
555− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
555+ LightDM.Greeter.showGreeter();
556+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
557+
558+ LightDM.Greeter.hideGreeter();
559+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
560+ }
556561
557− greeter.hide();
558− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
562+ function test_shellProfileChangesReachIndicators() {
563+ var panel = findChild(shell, "panel");
564+
565+ shell.indicatorProfile = "test1";
566+ for (var i = 0; i < panel.indicators.indicatorsModel.count; ++i) {
567+ var properties = panel.indicators.indicatorsModel.data(i, IndicatorsModelRole.IndicatorProperties);
568+ verify(properties["menuObjectPath"].substr(-5), "test1");
569+ }
570+
571+ shell.indicatorProfile = "test2";
572+ for (var i = 0; i < panel.indicators.indicatorsModel.count; ++i) {
573+ var properties = panel.indicators.indicatorsModel.data(i, IndicatorsModelRole.IndicatorProperties);
574+ verify(properties["menuObjectPath"].substr(-5), "test2");
575+ }
559576 }
560577
561578 function test_focusRequestedHidesGreeter() {
tests/qmltests/tst_ShellWithPin.qml+7−5
@@ -233,17 +233,19 @@ Item {
233233 }
234234
235235 function test_greeterChangesIndicatorProfile() {
236− var visibleIndicators = findChild(shell, "visibleIndicators");
237− tryCompare(visibleIndicators, "profile", shell.indicatorProfile + "_greeter");
236+ skip("Not supported yet, waiting on design for new settings panel");
237+
238+ var panel = findChild(shell, "panel");
239+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile + "_greeter");
238240
239241 LightDM.Greeter.hideGreeter();
240− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
242+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
241243
242244 LightDM.Greeter.showGreeter();
243− tryCompare(visibleIndicators, "profile", shell.indicatorProfile + "_greeter");
245+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile + "_greeter");
244246
245247 LightDM.Greeter.hideGreeter();
246− tryCompare(visibleIndicators, "profile", shell.indicatorProfile);
248+ tryCompare(panel.indicators.indicatorsModel, "profile", shell.indicatorProfile);
247249 }
248250
249251 function test_login() {