@@ -378,6 +378,38 @@ Item {
378378 tryCompare(item, "visible", false);
379379 }
380380
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);
385+
386+ tryCompare(app.surface, "focus", true);
387+
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);
396+
397+ tryCompare(app.surface, "focus", false);
398+
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);
405+
406+ tryCompare(app.surface, "focus", false);
407+
408+ dragToCloseIndicatorsPanel();
409+
410+ tryCompare(app.surface, "focus", true);
411+ }
412+
381413 // Wait for the whole UI to settle down
382414 function waitForUIToSettle() {
383415 waitUntilApplicationWindowIsFullyHidden();
@@ -385,6 +417,18 @@ Item {
385417 tryCompare(dashContentList, "moving", false);
386418 }
387419
420+ function dragToCloseIndicatorsPanel() {
421+ var indicators = findChild(shell, "indicators");
422+
423+ var touchStartX = shell.width / 2;
424+ var touchStartY = shell.height - (indicators.panelHeight * 0.5);
425+ touchFlick(shell,
426+ touchStartX, touchStartY,
427+ touchStartX, shell.height * 0.1);
428+
429+ tryCompare(indicators, "fullyClosed", true);
430+ }
431+
388432 function dragLauncherIntoView() {
389433 var launcherPanel = findChild(shell, "launcherPanel");
390434 verify(launcherPanel.x = - launcherPanel.width);