on xenial help sign in
more activecallhint tests
commit90ac2779db424e68783840a3efc11326933e727f authorNick Dedekind <nicholas.dedekind@gmail.com> dateTue 1 Jul 2014, 09:50 (12 years ago) parentaaa94eb
1 file changed+27−4
tests/qmltests/Panel/tst_ActiveCallHint.qml+27−4
tests/qmltests/Panel/tst_ActiveCallHint.qml+27−4
@@ -18,6 +18,7 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import Ubuntu.Telephony 0.1 as Telephony
21+import Unity.Application 0.1
2122import ".."
2223import "../../../qml/Panel"
2324
@@ -68,19 +69,41 @@ Item {
6869 callManager.foregroundCall = null;
6970 callManager.backgroundCall = null;
7071 callHint.labelSwitchInterval = 300;
72+
73+ ApplicationManager.stopApplication("dialer-app");
7174 }
7275
7376 function test_activeHint_data() {
7477 return [
75− { tag: "empty", callIndicatorVisible: false },
76− { tag: "empty", callIndicatorVisible: true }
78+ { tag: "noCall-callNotVisible", dialer: false, call: null, visible: false, expected: false },
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 },
82+
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 },
87+
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 },
7792 ];
7893 }
7994
8095 function test_activeHint(data) {
81− callManager.callIndicatorVisible = data.callIndicatorVisible;
96+ if (data.dialer) {
97+ var application = ApplicationManager.startApplication("dialer-app");
98+ tryCompare(ApplicationManager, "focusedApplicationId", "dialer-app");
99+ tryCompare(application, "state", ApplicationInfo.Running);
100+
101+ if (!data.focused) { ApplicationManager.unfocusCurrentApplication(); }
102+ }
103+ callManager.foregroundCall = data.call;
104+ callManager.callIndicatorVisible = data.visible;
82105
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");
84107 }
85108
86109 function test_currentCall_data() {