@@ -188,26 +188,34 @@ Item {
188 tapOnAppIconInLauncher();
188 tapOnAppIconInLauncher();
189 waitUntilApplicationWindowIsFullyVisible();
189 waitUntilApplicationWindowIsFullyVisible();
191− var mainApp = ApplicationManager.focusedApplicationId;
191+ var mainAppId = ApplicationManager.focusedApplicationId;
192− verify(mainApp != "");
192+ verify(mainAppId != "");
193+ var mainApp = ApplicationManager.findApplication(mainAppId);
195+ tryCompare(mainApp.state, ApplicationInfo.Running);
194 // Try to suspend while proximity is engaged...
197 // Try to suspend while proximity is engaged...
195 Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
198 Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
196 tryCompare(greeter, "showProgress", 0);
199 tryCompare(greeter, "showProgress", 0);
198 // Now really suspend
201 // Now really suspend
199 Powerd.displayPowerStateChange(Powerd.Off, 0);
203 Powerd.displayPowerStateChange(Powerd.Off, 0);
204+ print("done suspending")
200 tryCompare(greeter, "showProgress", 1);
205 tryCompare(greeter, "showProgress", 1);
201− tryCompare(ApplicationManager, "focusedApplicationId", "");
207+ tryCompare(ApplicationManager, "suspended", true);
208+ compare(mainApp.state, ApplicationInfo.Suspended);
203 // And wake up
210 // And wake up
204 Powerd.displayPowerStateChange(Powerd.On, 0);
211 Powerd.displayPowerStateChange(Powerd.On, 0);
205− tryCompare(ApplicationManager, "focusedApplicationId", "");
206 tryCompare(greeter, "showProgress", 1);
212 tryCompare(greeter, "showProgress", 1);
208 // Swipe away greeter to focus app
214 // Swipe away greeter to focus app
209 swipeAwayGreeter();
215 swipeAwayGreeter();
210− tryCompare(ApplicationManager, "focusedApplicationId", mainApp);
216+ tryCompare(ApplicationManager, "suspended", false);
217+ compare(mainApp.state, ApplicationInfo.Running);
218+ tryCompare(ApplicationManager, "focusedApplicationId", mainAppId);
213 function swipeAwayGreeter() {
221 function swipeAwayGreeter() {