@@ -354,6 +354,58 @@ Item {
354 verify(itemIsOnScreen(dashApps));
354 verify(itemIsOnScreen(dashApps));
357+ function test_showInputMethod() {
358+ var item = findChild(shell, "inputMethod");
359+ var surface = SurfaceManager.inputMethodSurface();
361+ surface.setState(MirSurfaceItem.Minimized);
362+ tryCompare(item, "visible", false);
364+ surface.setState(MirSurfaceItem.Restored);
365+ tryCompare(item, "visible", true);
367+ surface.setState(MirSurfaceItem.Minimized);
368+ tryCompare(item, "visible", false);
370+ surface.setState(MirSurfaceItem.Maximized);
371+ tryCompare(item, "visible", true);
373+ surface.setState(MirSurfaceItem.Minimized);
374+ tryCompare(item, "visible", false);
377+ function test_surfaceLosesFocusWhilePanelIsOpen() {
378+ var app = ApplicationManager.startApplication("dialer-app");
379+ // wait until the app is fully loaded (ie, real surface replaces splash screen)
380+ tryCompareFunction(function() { return app.surface != null }, true);
382+ tryCompare(app.surface, "focus", true);
384+ // Drag the indicators panel half-open
385+ var touchX = shell.width / 2;
386+ var indicators = findChild(shell, "indicators");
387+ touchFlick(indicators,
388+ touchX /* fromX */, indicators.panelHeight * 0.5 /* fromY */,
389+ touchX /* toX */, shell.height * 0.5 /* toY */,
390+ true /* beginTouch */, false /* endTouch */);
391+ verify(indicators.partiallyOpened);
393+ tryCompare(app.surface, "focus", false);
395+ // And finish getting it open
396+ touchFlick(indicators,
397+ touchX /* fromX */, shell.height * 0.5 /* fromY */,
398+ touchX /* toX */, shell.height * 0.9 /* toY */,
399+ false /* beginTouch */, true /* endTouch */);
400+ tryCompare(indicators, "fullyOpened", true);
402+ tryCompare(app.surface, "focus", false);
404+ dragToCloseIndicatorsPanel();
406+ tryCompare(app.surface, "focus", true);
357 // Wait for the whole UI to settle down
409 // Wait for the whole UI to settle down
358 function waitForUIToSettle() {
410 function waitForUIToSettle() {
359 waitUntilApplicationWindowIsFullyHidden();
411 waitUntilApplicationWindowIsFullyHidden();
@@ -361,6 +413,18 @@ Item {
361 tryCompare(dashContentList, "moving", false);
413 tryCompare(dashContentList, "moving", false);
416+ function dragToCloseIndicatorsPanel() {
417+ var indicators = findChild(shell, "indicators");
419+ var touchStartX = shell.width / 2;
420+ var touchStartY = shell.height - (indicators.panelHeight * 0.5);
422+ touchStartX, touchStartY,
423+ touchStartX, shell.height * 0.1);
425+ tryCompare(indicators, "fullyClosed", true);
364 function dragLauncherIntoView() {
428 function dragLauncherIntoView() {
365 var launcherPanel = findChild(shell, "launcherPanel");
429 var launcherPanel = findChild(shell, "launcherPanel");
366 verify(launcherPanel.x = - launcherPanel.width);
430 verify(launcherPanel.x = - launcherPanel.width);
@@ -485,7 +549,7 @@ Item {
485 {tag: "under greeter", greeter: true, app: false, launcher: false, indicators: false, expectedShown: false},
549 {tag: "under greeter", greeter: true, app: false, launcher: false, indicators: false, expectedShown: false},
486 {tag: "under app", greeter: false, app: true, launcher: false, indicators: false, expectedShown: false},
550 {tag: "under app", greeter: false, app: true, launcher: false, indicators: false, expectedShown: false},
487 {tag: "under launcher", greeter: false, app: false, launcher: true, indicators: false, expectedShown: true},
551 {tag: "under launcher", greeter: false, app: false, launcher: true, indicators: false, expectedShown: true},
488− {tag: "under indicators", greeter: false, app: false, launcher: false, indicators: true, expectedShown: true},
552+ {tag: "under indicators", greeter: false, app: false, launcher: false, indicators: true, expectedShown: false},
@@ -515,14 +579,24 @@ Item {
517 function test_focusRequestedHidesGreeter() {
581 function test_focusRequestedHidesGreeter() {
518− var greeter = findChild(shell, "greeter")
582+ var greeter = findChild(shell, "greeter");
520− greeter.show()
584+ var app = ApplicationManager.startApplication("dialer-app");
521− tryCompare(greeter, "showProgress", 1)
585+ // wait until the app is fully loaded (ie, real surface replaces splash screen)
586+ tryCompareFunction(function() { return app.surface != null }, true);
588+ // Minimize the application we just launched
589+ swipeFromLeftEdge(units.gu(27));
591+ // Wait for the whole UI to settle down
592+ waitUntilApplicationWindowIsFullyHidden();
595+ tryCompare(greeter, "showProgress", 1);
597+ // The main point of this test
523− ApplicationManager.focusRequested("notes-app")
598+ ApplicationManager.requestFocusApplication("dialer-app");
524− tryCompare(greeter, "showProgress", 0)
599+ tryCompare(greeter, "showProgress", 0);
525− waitUntilApplicationWindowIsFullyVisible()
528 function test_showGreeterDBusCall() {
602 function test_showGreeterDBusCall() {