on xenial help sign in
Fix tst_ActiveCallHint.qml
513449eDaniel d'Andrada
tests/qmltests/Panel/tst_ActiveCallHint.qml+16−2
@@ -41,6 +41,8 @@ Item {
41 elapsedTimerRunning: true
41 elapsedTimerRunning: true
42 }
42 }
43
43
44+ SurfaceManager {}
45+
44 ActiveCallHint {
46 ActiveCallHint {
45 id: callHint
47 id: callHint
46 anchors {
48 anchors {
@@ -95,18 +97,30 @@ Item {
95
97
96 function test_activeHint(data) {
98 function test_activeHint(data) {
97 if (data.dialer) {
99 if (data.dialer) {
100+ var dashApp = ApplicationManager.startApplication("unity8-dash");
101+ tryCompare(dashApp.surfaceList, "count", 1);
102+
98 var application = ApplicationManager.startApplication("dialer-app");
103 var application = ApplicationManager.startApplication("dialer-app");
99 tryCompare(application.surfaceList, "count", 1);
104 tryCompare(application.surfaceList, "count", 1);
100− MirFocusController.focusedSurface = application.surfaceList.get(0);
101 tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
105 tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
102 tryCompare(application, "state", ApplicationInfoInterface.Running);
106 tryCompare(application, "state", ApplicationInfoInterface.Running);
103
107
104− if (!data.focused) { MirFocusController.focusedSurface = null; }
108+ if (!data.focused) {
109+ dashApp.surfaceList.get(0).activate();
110+ tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
111+ }
105 }
112 }
106 callManager.foregroundCall = data.call;
113 callManager.foregroundCall = data.call;
107 callManager.callIndicatorVisible = data.visible;
114 callManager.callIndicatorVisible = data.visible;
108
115
109 compare(callHint.active, data.expected, "Call hint should be active when callIndicatorVisible=true");
116 compare(callHint.active, data.expected, "Call hint should be active when callIndicatorVisible=true");
117+
118+ if (data.dialer) {
119+ // clean up
120+ ApplicationManager.stopApplication("dialer-app");
121+ ApplicationManager.stopApplication("unity8-dash");
122+ tryCompare(ApplicationManager, "count", 0);
123+ }
110 }
124 }
111
125
112 function test_currentCall_data() {
126 function test_currentCall_data() {