@@ -21,6 +21,7 @@ import QtQuick 2.0
2121import QtTest 1.0
2222import GSettings 1.0
2323import LightDM 0.1 as LightDM
24+import Ubuntu.Telephony 0.1 as Telephony
2425import Unity.Application 0.1
2526import Unity.Connectivity 0.1
2627import Unity.Test 0.1 as UT
@@ -74,6 +75,11 @@ Item {
7475 signalName: "unlockingAllModems"
7576 }
7677
78+ Telephony.CallEntry {
79+ id: phoneCall
80+ phoneNumber: "+447812221111"
81+ }
82+
7783 UT.UnityTestCase {
7884 name: "Shell"
7985 when: windowShown
@@ -146,21 +152,22 @@ Item {
146152 verify(mainApp);
147153 tryCompare(mainApp, "state", ApplicationInfoInterface.Running);
148154
149− // Try to suspend while proximity is engaged...
150− Powerd.displayPowerStateChange(Powerd.Off, Powerd.Proximity);
155+ // Suspend while call is active...
156+ callManager.foregroundCall = phoneCall;
157+ Powerd.status = Powerd.Off;
151158 tryCompare(greeter, "showProgress", 0);
152159
153− // Now really suspend
154− print("suspending")
155− Powerd.displayPowerStateChange(Powerd.Off, 0);
156− print("done suspending")
160+ // Now try again after ending call
161+ callManager.foregroundCall = null;
162+ Powerd.status = Powerd.On;
163+ Powerd.status = Powerd.Off;
157164 tryCompare(greeter, "showProgress", 1);
158165
159166 tryCompare(ApplicationManager, "suspended", true);
160167 compare(mainApp.state, ApplicationInfoInterface.Suspended);
161168
162169 // And wake up
163− Powerd.displayPowerStateChange(Powerd.On, 0);
170+ Powerd.status = Powerd.On;
164171 tryCompare(greeter, "showProgress", 1);
165172
166173 // Swipe away greeter to focus app