@@ -15,6 +15,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18+import QtQuick.Layouts 1.1
18import QtTest 1.0
19import QtTest 1.0
19import ".."
20import ".."
20import "../../../qml/Greeter"
21import "../../../qml/Greeter"
@@ -23,12 +24,26 @@ import LightDM 0.1 as LightDM
23import Unity.Test 0.1 as UT
24import Unity.Test 0.1 as UT
26− width: units.gu(120)
28+ width: units.gu(140)
27 height: units.gu(80)
29 height: units.gu(80)
33+ property bool visible: fakeKeyboard.visible
34+ property var keyboardRectangle: QtObject {
35+ property real x: fakeKeyboard.x
36+ property real y: fakeKeyboard.y
37+ property real width: fakeKeyboard.width
38+ property real height: fakeKeyboard.height
30 id: greeter
43 id: greeter
31− anchors.fill: parent
44+ width: units.gu(120)
46+ inputMethod: fakeInputMethod
32 locked: !LightDM.Greeter.authenticated
47 locked: !LightDM.Greeter.authenticated
@@ -43,6 +58,44 @@ Item {
65+ anchors.bottom: root.bottom
67+ height: greeter.height * 0.6
68+ visible: keyboardVisibleCheckbox.checked
70+ text: "Keyboard Rectangle"
73+ fontSizeMode: Text.Fit
74+ minimumPixelSize: 10; font.pixelSize: 200
75+ verticalAlignment: Text.AlignVCenter
76+ x: (parent.width - width) / 2
77+ y: (parent.height - height) / 2
79+ height: parent.height
91+ Layout.fillWidth: true
93+ id: keyboardVisibleCheckbox
95+ Label { text: "Keyboard Visible"; anchors.verticalCenter: parent.verticalCenter }
46 SignalSpy {
99 SignalSpy {
47 id: unlockSpy
100 id: unlockSpy
48 target: greeter
101 target: greeter
@@ -65,6 +118,10 @@ Item {
65 name: "MultiGreeter"
118 name: "MultiGreeter"
66 when: windowShown
119 when: windowShown
121+ function cleanup() {
122+ keyboardVisibleCheckbox.checked = false;
68 function select_index(i) {
125 function select_index(i) {
69 // We could be anywhere in list; find target index to know which direction
126 // We could be anywhere in list; find target index to know which direction
70 var userlist = findChild(greeter, "userList")
127 var userlist = findChild(greeter, "userList")
@@ -382,5 +439,28 @@ Item {
382 tryCompare(spy, "count", 1)
439 tryCompare(spy, "count", 1)
383 greeterObj.destroy()
440 greeterObj.destroy()
443+ function test_login_list_not_covered_by_keyboard() {
444+ var loginList = findChild(greeter, "loginLoader").item;
445+ compare(loginList.height, greeter.height);
447+ // when the vkb shows up, loginList is moved up to remain fully uncovered
449+ keyboardVisibleCheckbox.checked = true;
451+ tryCompare(loginList, "height", greeter.height - fakeInputMethod.keyboardRectangle.height);
452+ tryCompareFunction( function() {
453+ var loginListRect = loginList.mapToItem(greeter, 0, 0, loginList.width, loginList.height);
454+ console.log("loginListRect.y " + loginListRect.y);
455+ console.log("loginListRect.height " + loginListRect.height);
456+ return loginListRect.y + loginListRect.height <= fakeInputMethod.keyboardRectangle.y;
459+ // once the vkb goes away, loginList goes back to its full height
461+ keyboardVisibleCheckbox.checked = false;
463+ tryCompare(loginList, "height", greeter.height);