@@ -18,6 +18,7 @@ import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19import Unity.Test 0.1 as UT
19import Unity.Test 0.1 as UT
20import Ubuntu.Telephony 0.1 as Telephony
20import Ubuntu.Telephony 0.1 as Telephony
21+import Unity.Application 0.1
21import ".."
22import ".."
22import "../../../qml/Panel"
23import "../../../qml/Panel"
@@ -68,19 +69,41 @@ Item {
68 callManager.foregroundCall = null;
69 callManager.foregroundCall = null;
69 callManager.backgroundCall = null;
70 callManager.backgroundCall = null;
70 callHint.labelSwitchInterval = 300;
71 callHint.labelSwitchInterval = 300;
73+ ApplicationManager.stopApplication("dialer-app");
73 function test_activeHint_data() {
76 function test_activeHint_data() {
75− { tag: "empty", callIndicatorVisible: false },
78+ { tag: "noCall-callNotVisible", dialer: false, call: null, visible: false, expected: false },
76− { tag: "empty", callIndicatorVisible: true }
79+ { tag: "noCall-callVisible", dialer: false, call: null, visible: true, expected: false },
80+ { tag: "hasCall-callNotVisible", dialer: false, call: call1, visible: false, expected: true },
81+ { tag: "hasCall-callVisible", dialer: false, call: call1, visible: true, expected: true },
83+ { tag: "dialerNotFocused-noCall-callNotVisible", dialer: true, focused: false, call: null, visible: false, expected: false },
84+ { tag: "dialerNotFocused-noCall-callVisible", dialer: true, focused: false, call: null, visible: true, expected: false },
85+ { tag: "dialerNotFocused-hasCall-callNotVisible", dialer: true, focused: false, call: call1, visible: false, expected: true },
86+ { tag: "dialerNotFocused-hasCall-callVisible", dialer: true, focused: false, call: call1, visible: true, expected: true },
88+ { tag: "dialerFocused-noCall-callNotVisible", dialer: true, focused: true, call: null, visible: false, expected: false },
89+ { tag: "dialerFocused-noCall-callVisible", dialer: true, focused: true, call: null, visible: true, expected: true },
90+ { tag: "dialerFocused-hasCall-callNotVisible", dialer: true, focused: true, call: call1, visible: false, expected: false },
91+ { tag: "dialerFocused-hasCall-callVisible", dialer: true, focused: true, call: call1, visible: true, expected: true },
80 function test_activeHint(data) {
95 function test_activeHint(data) {
97+ var application = ApplicationManager.startApplication("dialer-app");
98+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
99+ tryCompare(application, "state", ApplicationInfo.Running);
101+ if (!data.focused) { ApplicationManager.unfocusCurrentApplication(); }
103+ callManager.foregroundCall = data.call;
81− callManager.callIndicatorVisible = data.callIndicatorVisible;
104+ callManager.callIndicatorVisible = data.visible;
83− compare(callHint.active, data.callIndicatorVisible, "Call hint should be active when callIndicatorVisible=true");
106+ compare(callHint.active, data.expected, "Call hint should be active when callIndicatorVisible=true");
86 function test_currentCall_data() {
109 function test_currentCall_data() {