187
188
tapOnAppIconInLauncher();
188
189
waitUntilApplicationWindowIsFullyVisible();
190
var mainApp = ApplicationManager.focusedApplicationId;
191
verify(mainApp != "");
191
var mainAppId = ApplicationManager.focusedApplicationId;
192
verify(mainAppId != "");
193
var mainApp = ApplicationManager.findApplication(mainAppId);
195
tryCompare(mainApp.state, ApplicationInfo.Running);
193
197
// Try to suspend while proximity is engaged...
194
198
Powerd.displayPowerStateChange(Powerd.Off, Powerd.UseProximity);
195
199
tryCompare(greeter, "showProgress", 0);
197
201
// Now really suspend
198
203
Powerd.displayPowerStateChange(Powerd.Off, 0);
204
print("done suspending")
199
205
tryCompare(greeter, "showProgress", 1);
200
tryCompare(ApplicationManager, "focusedApplicationId", "");
207
tryCompare(ApplicationManager, "suspended", true);
208
compare(mainApp.state, ApplicationInfo.Suspended);
203
211
Powerd.displayPowerStateChange(Powerd.On, 0);
204
tryCompare(ApplicationManager, "focusedApplicationId", "");
205
212
tryCompare(greeter, "showProgress", 1);
207
214
// Swipe away greeter to focus app
208
215
swipeAwayGreeter();
209
tryCompare(ApplicationManager, "focusedApplicationId", mainApp);
216
tryCompare(ApplicationManager, "suspended", false);
217
compare(mainApp.state, ApplicationInfo.Running);
218
tryCompare(ApplicationManager, "focusedApplicationId", mainAppId);
212
221
function swipeAwayGreeter() {
239
248
tryCompare(dash, "opacity", 1.0);
241
250
touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
242
true /* beginTouch */, false /* endTouch */);
251
true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
244
253
// check that Dash has been scaled down and had its opacity reduced
245
254
tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
270
279
tryCompare(dash, "opacity", 1.0);
272
281
touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
273
true /* beginTouch */, false /* endTouch */);
282
true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
275
284
// check that Dash has been scaled down and had its opacity reduced
276
285
tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);