@@ -678,14 +678,25 @@ Item {
678678 tryCompare(closeButton, "visible", false);
679679 }
680680
681− function test_oskDisplacesWindow() {
681+ function test_oskDisplacesWindow_data() {
682+ return [
683+ {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5)},
684+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight},
685+ {tag: "displace a bit", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: (root.height / 2) - units.gu(40)},
686+ ]
687+ }
688+
689+ function test_oskDisplacesWindow(data) {
682690 var dashAppDelegate = startApplication("unity8-dash");
683691 verify(dashAppDelegate);
692+ dashAppDelegate.requestedHeight = data.windowHeight;
693+ dashAppDelegate.requestedY = data.windowY;
694+ UbuntuKeyboardInfo.height = 0;
684695 var initialY = dashAppDelegate.y;
685696 verify(initialY > PanelState.panelHeight);
686697
687− UbuntuKeyboardInfo.height = units.gu(10);
688− tryCompare(dashAppDelegate, "y", PanelState.panelHeight);
698+ UbuntuKeyboardInfo.height = root.height / 2;
699+ tryCompare(dashAppDelegate, "y", data.targetDisplacement);
689700
690701 UbuntuKeyboardInfo.height = 0;
691702 tryCompare(dashAppDelegate, "y", initialY);