@@ -678,14 +678,25 @@ Item {
678 tryCompare(closeButton, "visible", false);
678 tryCompare(closeButton, "visible", false);
681+ function test_oskDisplacesWindow_data() {
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)},
681− function test_oskDisplacesWindow() {
689+ function test_oskDisplacesWindow(data) {
682 var dashAppDelegate = startApplication("unity8-dash");
690 var dashAppDelegate = startApplication("unity8-dash");
683 verify(dashAppDelegate);
691 verify(dashAppDelegate);
692+ dashAppDelegate.requestedHeight = data.windowHeight;
693+ dashAppDelegate.requestedY = data.windowY;
694+ UbuntuKeyboardInfo.height = 0;
684 var initialY = dashAppDelegate.y;
695 var initialY = dashAppDelegate.y;
685 verify(initialY > PanelState.panelHeight);
696 verify(initialY > PanelState.panelHeight);
687− UbuntuKeyboardInfo.height = units.gu(10);
698+ UbuntuKeyboardInfo.height = root.height / 2;
688− tryCompare(dashAppDelegate, "y", PanelState.panelHeight);
699+ tryCompare(dashAppDelegate, "y", data.targetDisplacement);
690 UbuntuKeyboardInfo.height = 0;
701 UbuntuKeyboardInfo.height = 0;
691 tryCompare(dashAppDelegate, "y", initialY);
702 tryCompare(dashAppDelegate, "y", initialY);