@@ -378,6 +378,38 @@ Item {
378 tryCompare(item, "visible", false);
378 tryCompare(item, "visible", false);
381+ function test_surfaceLosesFocusWhilePanelIsOpen() {
382+ var app = ApplicationManager.startApplication("dialer-app");
383+ // wait until the app is fully loaded (ie, real surface replaces splash screen)
384+ tryCompareFunction(function() { return app.surface != null }, true);
386+ tryCompare(app.surface, "focus", true);
388+ // Drag the indicators panel half-open
389+ var touchX = shell.width / 2;
390+ var indicators = findChild(shell, "indicators");
391+ touchFlick(indicators,
392+ touchX /* fromX */, indicators.panelHeight * 0.5 /* fromY */,
393+ touchX /* toX */, shell.height * 0.5 /* toY */,
394+ true /* beginTouch */, false /* endTouch */);
395+ verify(indicators.partiallyOpened);
397+ tryCompare(app.surface, "focus", false);
399+ // And finish getting it open
400+ touchFlick(indicators,
401+ touchX /* fromX */, shell.height * 0.5 /* fromY */,
402+ touchX /* toX */, shell.height * 0.9 /* toY */,
403+ false /* beginTouch */, true /* endTouch */);
404+ tryCompare(indicators, "fullyOpened", true);
406+ tryCompare(app.surface, "focus", false);
408+ dragToCloseIndicatorsPanel();
410+ tryCompare(app.surface, "focus", true);
381 // Wait for the whole UI to settle down
413 // Wait for the whole UI to settle down
382 function waitForUIToSettle() {
414 function waitForUIToSettle() {
383 waitUntilApplicationWindowIsFullyHidden();
415 waitUntilApplicationWindowIsFullyHidden();
@@ -385,6 +417,18 @@ Item {
385 tryCompare(dashContentList, "moving", false);
417 tryCompare(dashContentList, "moving", false);
420+ function dragToCloseIndicatorsPanel() {
421+ var indicators = findChild(shell, "indicators");
423+ var touchStartX = shell.width / 2;
424+ var touchStartY = shell.height - (indicators.panelHeight * 0.5);
426+ touchStartX, touchStartY,
427+ touchStartX, shell.height * 0.1);
429+ tryCompare(indicators, "fullyClosed", true);
388 function dragLauncherIntoView() {
432 function dragLauncherIntoView() {
389 var launcherPanel = findChild(shell, "launcherPanel");
433 var launcherPanel = findChild(shell, "launcherPanel");
390 verify(launcherPanel.x = - launcherPanel.width);
434 verify(launcherPanel.x = - launcherPanel.width);