Merge lp:~unity-team/unity/phablet-pinlock into lp:unity/phablet

Proposed by Michael Zanetti
Status: Superseded
Proposed branch: lp:~unity-team/unity/phablet-pinlock
Merge into: lp:unity/phablet
Diff against target: 1936 lines (+1298/-173)
35 files modified
Greeter/Greeter.qml (+2/-2)
Greeter/Lockscreen.qml (+142/-0)
Greeter/PassphraseLockscreen.qml (+107/-0)
Greeter/PinLockscreen.qml (+131/-0)
Greeter/PinPadButton.qml (+60/-0)
Shell.qml (+45/-7)
cmake/modules/QmlTest.cmake (+2/-1)
plugins/LightDM/CMakeLists.txt (+1/-1)
run (+18/-2)
run_on_device (+18/-5)
tests/autopilot/qml_phone_shell/tests/__init__.py (+4/-2)
tests/autopilot/qml_phone_shell/tests/testcases.py (+4/-4)
tests/mocks/LightDM/CMakeLists.txt (+6/-1)
tests/mocks/LightDM/demo/CMakeLists.txt (+1/-0)
tests/mocks/LightDM/demo/GreeterPrivate.cpp (+3/-10)
tests/mocks/LightDM/demo/InfographicModelPrivate.cpp (+3/-118)
tests/mocks/LightDM/demo/UsersModelPrivate.cpp (+1/-5)
tests/mocks/LightDM/full/GreeterPrivate.cpp (+7/-1)
tests/mocks/LightDM/full/UsersModelPrivate.cpp (+1/-0)
tests/mocks/LightDM/single-passphrase/CMakeLists.txt (+21/-0)
tests/mocks/LightDM/single-passphrase/GreeterPrivate.cpp (+53/-0)
tests/mocks/LightDM/single-passphrase/InfographicModelPrivate.cpp (+61/-0)
tests/mocks/LightDM/single-passphrase/UsersModelPrivate.cpp (+33/-0)
tests/mocks/LightDM/single-pin/CMakeLists.txt (+21/-0)
tests/mocks/LightDM/single-pin/GreeterPrivate.cpp (+53/-0)
tests/mocks/LightDM/single-pin/InfographicModelPrivate.cpp (+61/-0)
tests/mocks/LightDM/single-pin/UsersModelPrivate.cpp (+33/-0)
tests/mocks/LightDM/single/CMakeLists.txt (+20/-0)
tests/mocks/LightDM/single/GreeterPrivate.cpp (+48/-0)
tests/mocks/LightDM/single/InfographicModelPrivate.cpp (+28/-0)
tests/mocks/LightDM/single/UsersModelPrivate.cpp (+33/-0)
tests/qmltests/CMakeLists.txt (+5/-1)
tests/qmltests/Greeter/tst_Lockscreen.qml (+205/-0)
tests/qmltests/Greeter/tst_Phone.qml (+62/-0)
tests/qmltests/Greeter/tst_Tablet.qml (+5/-13)
To merge this branch: bzr merge lp:~unity-team/unity/phablet-pinlock
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity Team Pending
Review via email: mp+165924@code.launchpad.net

This proposal has been superseded by a proposal from 2013-06-03.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

I haven't looked at the new code yet, but here's a review of some of the touch points with existing code:

670 + LightDM.Greeter.authenticate("has-pin")

Testing code?

715 + } else if (authenticationUser == "has-pin"){
716 + Q_EMIT q->showPrompt("Please enter your PIN:", Greeter::PromptTypeSecret);

Please make that just "PIN". That's what the pam_pin module does. And Shell.qml should check for an exact match, not an indexOf. In the UI, you can check for the string and present a nicer one if needed.

723 - Q_EMIT q->showPrompt("Password: ", Greeter::PromptTypeSecret);
724 + Q_EMIT q->showPrompt("Please enter your password:", Greeter::PromptTypeSecret);

PAM will likely just give us "Password:", so we should keep our mock close to that. Plus, you'll have to change some of the qmltests that check for "Password" being passed back. You can, however, check in the UI if the string is "Password" and present something nicer. It's not translated from PAM. (Which reminds me, we should pass it through gettext in LoginList.qml)

732 - authenticated = (response == "password");
733 + if (authenticationUser == "has-password") {
734 + authenticated = (response == "password");

Actually, not only has-password has a password. All the users are assumed to have "password" as their password unless otherwise specified. (And no-password users never get to the handleRespond() function) So please just check for the pin user and fallback to checking for "password".

751 + { "has-pin", "Has PIN", 0, 0, false, false, 0, 0 },

I see you added the user to the "full" mock lightdm. I think it would be more useful to add a new mock liblightdm that only has the pin user. That way we can get a more phone-like experience.

See https://code.launchpad.net/~mterry/unity/phablet-greeter-single-user/+merge/166296 which will make the phone UI only active if there's just one user. And it shows how to add a new mock liblightdm (and corrects a couple bugs with our current multiple mock support).

Revision history for this message
Michael Terry (mterry) wrote :

Actually, let me double confirm that "Password: " is not translated from PAM. I see that it's marked for translation in PAM, but I thought LightDM used the C locale for that. It's hard to tell from the lightdm source, so I'll ask Robert.

Revision history for this message
Michael Terry (mterry) wrote :

<mterry> robert_ancell, does LightDM use the C locale with PAM, or will it actually get translated prompts back from it?
<robert_ancell> mterry, in trunk it uses the correct locale, in older versions the C locale

So... The prompt will be potentially translated, so we shouldn't check for "Password" like I proposed.

But my comment about keeping close to what PAM will give us in the mocks and just use "Password: " still stands.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> 670 + LightDM.Greeter.authenticate("has-pin")
> Testing code?

Don't really know. Somehow this needs to be triggered so designers and testers can have a go. I'm still unsure who actually should trigger this when the screen locks... This seemed like a sensible place to me. Where would you trigger the locking?

> 715 + } else if (authenticationUser == "has-pin"){
> 716 + Q_EMIT q->showPrompt("Please enter your PIN:",
> Greeter::PromptTypeSecret);
>
> Please make that just "PIN". That's what the pam_pin module does. And
> Shell.qml should check for an exact match, not an indexOf. In the UI, you can
> check for the string and present a nicer one if needed.

Done.

> 723 - Q_EMIT q->showPrompt("Password: ", Greeter::PromptTypeSecret);
> 724 + Q_EMIT q->showPrompt("Please enter your password:",
> Greeter::PromptTypeSecret);
>
> PAM will likely just give us "Password:", so we should keep our mock close to
> that. Plus, you'll have to change some of the qmltests that check for
> "Password" being passed back. You can, however, check in the UI if the string
> is "Password" and present something nicer. It's not translated from PAM.
> (Which reminds me, we should pass it through gettext in LoginList.qml)
>
> 732 - authenticated = (response == "password");
> 733 + if (authenticationUser == "has-password") {
> 734 + authenticated = (response == "password");
>
> Actually, not only has-password has a password. All the users are assumed to
> have "password" as their password unless otherwise specified. (And no-
> password users never get to the handleRespond() function) So please just
> check for the pin user and fallback to checking for "password".

Done.

> 751 + { "has-pin", "Has PIN", 0, 0, false, false, 0, 0 },
>
> I see you added the user to the "full" mock lightdm. I think it would be more
> useful to add a new mock liblightdm that only has the pin user. That way we
> can get a more phone-like experience.

No. Because I need also the password user for the tests. This code does not only handle PINs but also passphrases by now. Don't think its useful to have another two single-user backends for those use cases when it can be handled by the full backend easily.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> <mterry> robert_ancell, does LightDM use the C locale with PAM, or will it
> actually get translated prompts back from it?
> <robert_ancell> mterry, in trunk it uses the correct locale, in older versions
> the C locale
>
> So... The prompt will be potentially translated, so we shouldn't check for
> "Password" like I proposed.
>
> But my comment about keeping close to what PAM will give us in the mocks and
> just use "Password: " still stands.

Waiting for some guidance on what to do here.

Revision history for this message
Michael Terry (mterry) wrote :

723 - Q_EMIT q->showPrompt("Password: ", Greeter::PromptTypeSecret);
724 + Q_EMIT q->showPrompt("Password:", Greeter::PromptTypeSecret);

This looks like an accidental change. We want to keep that space there to test that we strip the space successfully.

Additionally, we talked on IRC about how I'd like to see a new mock for a single PIN user.

lp:~unity-team/unity/phablet-pinlock updated
693. By Michael Zanetti

revert accidental change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:693
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~unity-team/unity/phablet-pinlock/+merge/165924/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-phablet-ci/1123/
Executed test runs:
    FAILURE: http://s-jenkins:8080/job/unity-phablet-qmluitests/1145/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-armhf-ci/998/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-i386-ci/1002/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-phablet-ci/1123/rebuild

review: Needs Fixing (continuous-integration)
lp:~unity-team/unity/phablet-pinlock updated
694. By Michael Zanetti

merge trunk

695. By Michael Zanetti

always show password lockscreen (temporary)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:695
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~unity-team/unity/phablet-pinlock/+merge/165924/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-phablet-ci/1124/
Executed test runs:
    FAILURE: http://s-jenkins:8080/job/unity-phablet-qmluitests/1146/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-armhf-ci/999/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-i386-ci/1003/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-phablet-ci/1124/rebuild

review: Needs Fixing (continuous-integration)
lp:~unity-team/unity/phablet-pinlock updated
696. By Michael Zanetti

added single user lightdm backend

use that by default, add -d to select demo one

697. By Michael Zanetti

revert to defaulting to the demo users

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:696
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~unity-team/unity/phablet-pinlock/+merge/165924/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-phablet-ci/1126/
Executed test runs:
    FAILURE: http://s-jenkins:8080/job/unity-phablet-qmluitests/1148/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-armhf-ci/1001/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-i386-ci/1005/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-phablet-ci/1126/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:697
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~unity-team/unity/phablet-pinlock/+merge/165924/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-phablet-ci/1128/
Executed test runs:
    FAILURE: http://s-jenkins:8080/job/unity-phablet-qmluitests/1150/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-armhf-ci/1003/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-i386-ci/1007/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-phablet-ci/1128/rebuild

review: Needs Fixing (continuous-integration)
lp:~unity-team/unity/phablet-pinlock updated
698. By Michael Zanetti

merge with mterry's single user branch

699. By Michael Zanetti

merge mterry single user branch

700. By Michael Zanetti

added a PIN test lib and a passphrase test lib

added -p and -k to run them

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:700
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~unity-team/unity/phablet-pinlock/+merge/165924/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-phablet-ci/1129/
Executed test runs:
    FAILURE: http://s-jenkins:8080/job/unity-phablet-qmluitests/1151/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-armhf-ci/1004/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-raring-i386-ci/1008/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/unity-phablet-ci/1129/rebuild

review: Needs Fixing (continuous-integration)
lp:~unity-team/unity/phablet-pinlock updated
701. By Michael Zanetti

don't go to fullscreen mode as long as the lockscreen is here

702. By Michael Zanetti

reset lockscreen when greeter activates

703. By Michael Zanetti

make it translateable

704. By Michael Zanetti

remove debug echo

705. By Michael Zanetti

fix whitespaces

706. By Michael Zanetti

update usage() of run_on_device

707. By Michael Zanetti

fix getopts short args

708. By Michael Zanetti

remove unused imports

709. By Michael Zanetti

abstract WrongPasswordAnimation

710. By Michael Zanetti

fix some coding style issues

711. By Michael Zanetti

fix whitespace issues again

712. By Michael Zanetti

added missing copyright header

Revision history for this message
Michael Terry (mterry) wrote :

Looks mostly fine to me.

566 + // If there is only one user, we start authenticating with that one here.
567 + // If there are more users, the Greeter will handle that
568 + if (LightDM.Users.count == 1) {
569 + LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
570 + }

This feels a bit mismatched. I don't like the different code paths, though I get why you did it. No change requested, just noting.

As for the testing changes... I love the new plugins. But why add the has-pin user to the full/ plugin? I'd assume the single-pin/ plugin was the choice for testing the PIN screen. Similarly, the passphrase screen isn't tested via the single-passphrase/ plugin.

Unmerged revisions

712. By Michael Zanetti

added missing copyright header

711. By Michael Zanetti

fix whitespace issues again

710. By Michael Zanetti

fix some coding style issues

709. By Michael Zanetti

abstract WrongPasswordAnimation

708. By Michael Zanetti

remove unused imports

707. By Michael Zanetti

fix getopts short args

706. By Michael Zanetti

update usage() of run_on_device

705. By Michael Zanetti

fix whitespaces

704. By Michael Zanetti

remove debug echo

703. By Michael Zanetti

make it translateable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Greeter/Greeter.qml'
--- Greeter/Greeter.qml 2013-05-20 11:05:59 +0000
+++ Greeter/Greeter.qml 2013-06-03 18:14:27 +0000
@@ -27,8 +27,8 @@
27 property alias model: greeterContentLoader.model27 property alias model: greeterContentLoader.model
28 property bool locked: shown && multiUser && !greeterContentLoader.promptless28 property bool locked: shown && multiUser && !greeterContentLoader.promptless
2929
30 readonly property bool narrowMode: width <= units.gu(60)30 readonly property bool narrowMode: !multiUser && width <= units.gu(60)
31 readonly property bool multiUser: !narrowMode // TODO: populate with real value31 readonly property bool multiUser: LightDM.Users.count > 1
3232
33 readonly property bool leftTeaserPressed: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.leftTeaserPressed33 readonly property bool leftTeaserPressed: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.leftTeaserPressed
3434
3535
=== added file 'Greeter/Lockscreen.qml'
--- Greeter/Lockscreen.qml 1970-01-01 00:00:00 +0000
+++ Greeter/Lockscreen.qml 2013-06-03 18:14:27 +0000
@@ -0,0 +1,142 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtGraphicalEffects 1.0
19import Ubuntu.Components 0.1
20import "../Components"
21import LightDM 0.1 as LightDM
22
23Showable {
24 id: root
25
26 // Determine if a numeric or alphanumeric pad is used.
27 property bool alphaNumeric: false
28
29 // Placeholder text
30 property string placeholderText: ""
31
32 // In case the Lockscreen can show a greeter message, this is the username
33 property string username: ""
34
35 // As the numeric PIN pad doesn't have a OK button by design, we need to auto-confirm on a certain length.
36 // This is ignored by the alphaNumeric lockscreen as that one is confirmed with pressing enter on the OSK.
37 property int pinLength: 4
38
39 property url background: ""
40
41 signal unlocked()
42 signal cancel()
43 signal emergencyCall()
44
45 Image {
46 anchors.fill: parent
47 source: root.required ? root.background : ""
48 }
49
50 MouseArea {
51 anchors.fill: root
52 }
53
54 Loader {
55 id: pinPadLoader
56 objectName: "pinPadLoader"
57 anchors {
58 left: parent.left
59 right: parent.right
60 verticalCenter: parent.verticalCenter
61 verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : 0
62 }
63
64 source: root.alphaNumeric ? "PassphraseLockscreen.qml" : "PinLockscreen.qml"
65
66 Connections {
67 target: pinPadLoader.item
68
69 onEntered: {
70 LightDM.Greeter.respond(passphrase);
71 }
72
73 onCancel: {
74 root.cancel()
75 }
76 }
77
78 Binding {
79 target: pinPadLoader.item
80 property: "pinLength"
81 value: root.pinLength
82 }
83 Binding {
84 target: pinPadLoader.item
85 property: "placeholderText"
86 value: root.placeholderText
87 }
88 Binding {
89 target: pinPadLoader.item
90 property: "username"
91 value: root.username
92 }
93 }
94
95 Column {
96 anchors {
97 left: parent.left
98 top: pinPadLoader.bottom
99 topMargin: units.gu(4)
100 right: parent.right
101 bottom: parent.bottom
102 }
103 spacing: units.gu(1)
104 Icon {
105 objectName: "emergencyCallIcon"
106 height: units.gu(3)
107 width: height
108 anchors.horizontalCenter: parent.horizontalCenter
109 name: "phone-app-call-symbolic"
110 color: "white"
111 opacity: 0.9
112
113 MouseArea {
114 anchors.fill: parent
115 onClicked: root.emergencyCall()
116 }
117 }
118 Label {
119 text: "Emergency call"
120 color: "white"
121 opacity: 0.9
122 fontSize: "medium"
123 anchors.horizontalCenter: parent.horizontalCenter
124 }
125 }
126
127 Connections {
128 target: LightDM.Greeter
129
130 onAuthenticationComplete: {
131 if (LightDM.Greeter.promptless) {
132 return;
133 }
134 if (LightDM.Greeter.authenticated) {
135 root.unlocked();
136 pinPadLoader.item.clear(false);
137 } else {
138 pinPadLoader.item.clear(true);
139 }
140 }
141 }
142}
0143
=== added file 'Greeter/PassphraseLockscreen.qml'
--- Greeter/PassphraseLockscreen.qml 1970-01-01 00:00:00 +0000
+++ Greeter/PassphraseLockscreen.qml 2013-06-03 18:14:27 +0000
@@ -0,0 +1,107 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20Item {
21 id: root
22 height: highlightItem.height
23
24 property alias placeholderText: pinentryField.placeholderText
25 property string username: ""
26
27 signal entered(string passphrase)
28 signal cancel()
29
30 function clear(playAnimation) {
31 pinentryField.text = "";
32 if (playAnimation) {
33 wrongPasswordAnimation.start();
34 } else {
35 pinentryField.focus = false
36 }
37 }
38
39 Rectangle {
40 id: highlightItem
41 width: units.gu(32)
42 height: units.gu(10)
43 anchors.centerIn: parent
44 color: Qt.rgba(0.1, 0.1, 0.1, 0.4)
45 border.color: Qt.rgba(0.4, 0.4, 0.4, 0.4)
46 border.width: units.dp(1)
47 radius: units.gu(1.5)
48 antialiasing: true
49
50 Label {
51 objectName: "greeterLabel"
52 anchors {
53 left: parent.left
54 top: parent.top
55 right: parent.right
56 margins: units.gu(1.5)
57 }
58 text: root.username.length > 0 ? "Hello %1".arg(root.username) : ""
59 color: "white"
60 }
61
62 TextField {
63 id: pinentryField
64 objectName: "pinentryField"
65 anchors {
66 horizontalCenter: parent.horizontalCenter
67 bottom: parent.bottom
68 margins: units.gu(1)
69 }
70 height: units.gu(4.5)
71 width: parent.width - units.gu(2)
72 echoMode: TextInput.Password
73 opacity: 0.9
74 hasClearButton: false
75
76 onAccepted: {
77 root.entered(pinentryField.text);
78 }
79 }
80 }
81
82 SequentialAnimation {
83 id: wrongPasswordAnimation
84 NumberAnimation {
85 target: pinentryField
86 property: "anchors.horizontalCenterOffset"
87 duration: 50
88 easing.type: Easing.InQuad
89 to: units.gu(2)
90 }
91 NumberAnimation {
92 target: pinentryField
93 property: "anchors.horizontalCenterOffset"
94 duration: 100
95 easing.type: Easing.InOutQuad
96 to: -units.gu(2)
97 }
98 NumberAnimation {
99 target: pinentryField
100 easing.type: Easing.OutElastic
101 properties: "anchors.horizontalCenterOffset"
102 to: 0
103 duration: 400
104 easing.overshoot: units.gu(2)
105 }
106 }
107}
0108
=== added file 'Greeter/PinLockscreen.qml'
--- Greeter/PinLockscreen.qml 1970-01-01 00:00:00 +0000
+++ Greeter/PinLockscreen.qml 2013-06-03 18:14:27 +0000
@@ -0,0 +1,131 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20Column {
21 id: root
22 anchors.centerIn: parent
23 spacing: units.gu(2.5)
24
25 property alias placeholderText: pinentryField.placeholderText
26 property int padWidth: units.gu(32)
27 property int pinLength: 4
28
29 signal entered(string passphrase)
30 signal cancel()
31
32 function clear(playAnimation) {
33 pinentryField.text = "";
34 if (playAnimation) {
35 wrongPasswordAnimation.start();
36 }
37 }
38
39 TextField {
40 id: pinentryField
41 objectName: "pinentryField"
42 anchors.horizontalCenter: parent.horizontalCenter
43 width: units.gu(32)
44 height: units.gu(5)
45 echoMode: TextInput.Password
46 font.pixelSize: units.dp(44)
47 color: "white"
48 opacity: 0.9
49 hasClearButton: false
50 horizontalAlignment: Text.AlignHCenter
51
52 onTextChanged: {
53 if (pinentryField.text.length === root.pinLength) {
54 root.entered(pinentryField.text);
55 }
56 }
57
58 // Using a MouseArea to eat clicks. We don't want to disable the TextField for styling reasons
59 MouseArea {
60 anchors.fill: parent
61 }
62 }
63
64 Grid {
65 anchors {
66 left: parent.left
67 right: parent.right
68 margins: (parent.width - root.padWidth) / 2
69 }
70
71 columns: 3
72 spacing: units.gu(1)
73
74 Repeater {
75 model: 9
76
77 PinPadButton {
78 objectName: "pinPadButton" + (index + 1)
79 text: index + 1
80
81 onClicked: {
82 pinentryField.text = pinentryField.text + text
83 }
84 }
85 }
86
87 PinPadButton {
88 objectName: "pinPadButtonBack"
89 iconName: "back"
90 onClicked: root.cancel();
91
92 }
93 PinPadButton {
94 objectName: "pinPadButton0"
95 text: "0"
96 onClicked: pinentryField.text = pinentryField.text + text
97
98 }
99 PinPadButton {
100 objectName: "pinPadButtonErase"
101 iconName: "erase"
102 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
103 }
104 }
105
106 SequentialAnimation {
107 id: wrongPasswordAnimation
108 NumberAnimation {
109 target: pinentryField
110 property: "anchors.horizontalCenterOffset"
111 duration: 50
112 easing.type: Easing.InQuad
113 to: units.gu(2)
114 }
115 NumberAnimation {
116 target: pinentryField
117 property: "anchors.horizontalCenterOffset"
118 duration: 100
119 easing.type: Easing.InOutQuad
120 to: -units.gu(2)
121 }
122 NumberAnimation {
123 target: pinentryField
124 easing.type: Easing.OutElastic
125 properties: "anchors.horizontalCenterOffset"
126 to: 0
127 duration: 400
128 easing.overshoot: units.gu(2)
129 }
130 }
131}
0132
=== added file 'Greeter/PinPadButton.qml'
--- Greeter/PinPadButton.qml 1970-01-01 00:00:00 +0000
+++ Greeter/PinPadButton.qml 2013-06-03 18:14:27 +0000
@@ -0,0 +1,60 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19
20UbuntuShape {
21 id: root
22 width: units.gu(10)
23 height: units.gu(7)
24 radius: "medium"
25
26 property alias text: label.text
27 property alias iconName: icon.name
28
29 signal clicked()
30
31 Behavior on color {
32 ColorAnimation { duration: 100 }
33 }
34
35 Label {
36 id: label
37 anchors.centerIn: parent
38 color: "white"
39 fontSize: "x-large"
40 font.weight: Font.Light
41 opacity: 0.9
42 }
43
44 Icon {
45 id: icon
46 height: units.gu(3)
47 width: height
48 anchors.centerIn: parent
49 color: "white"
50 opacity: 0.9
51 }
52
53 MouseArea {
54 anchors.fill: parent
55 onClicked: root.clicked()
56 onPressed: root.color = Qt.rgba(0, 0, 0, 0.3)
57 onReleased: root.color = Qt.rgba(0, 0, 0, 0)
58 }
59}
60
061
=== modified file 'Shell.qml'
--- Shell.qml 2013-06-03 08:29:01 +0000
+++ Shell.qml 2013-06-03 18:14:27 +0000
@@ -17,6 +17,7 @@
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Application 0.118import Ubuntu.Application 0.1
19import Ubuntu.Components 0.119import Ubuntu.Components 0.1
20import QtGraphicalEffects 1.0
20import LightDM 0.1 as LightDM21import LightDM 0.1 as LightDM
21import "Dash"22import "Dash"
22import "Greeter"23import "Greeter"
@@ -124,7 +125,6 @@
124125
125 Item {126 Item {
126 id: underlay127 id: underlay
127
128 anchors.fill: parent128 anchors.fill: parent
129 visible: !(panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)129 visible: !(panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth)
130 && (stages.fullyHidden130 && (stages.fullyHidden
@@ -148,7 +148,7 @@
148 Dash {148 Dash {
149 id: dash149 id: dash
150150
151 available: !greeter.shown151 available: !greeter.shown && !lockscreen.shown
152 hides: [stages, launcher, panel.indicators]152 hides: [stages, launcher, panel.indicators]
153 shown: disappearingAnimationProgress !== 1.0153 shown: disappearingAnimationProgress !== 1.0
154 enabled: disappearingAnimationProgress === 0.0154 enabled: disappearingAnimationProgress === 0.0
@@ -301,7 +301,7 @@
301 && sideStage[sideStageRevealer.boundProperty] == sideStageRevealer.openedValue301 && sideStage[sideStageRevealer.boundProperty] == sideStageRevealer.openedValue
302 shouldUseScreenshots: !fullyShown || mainStage.usingScreenshots || sideStageRevealer.pressed302 shouldUseScreenshots: !fullyShown || mainStage.usingScreenshots || sideStageRevealer.pressed
303303
304 available: !greeter.shown && enabled304 available: !greeter.shown && !lockscreen.shown && enabled
305 hides: [launcher, panel.indicators]305 hides: [launcher, panel.indicators]
306 shown: false306 shown: false
307 showAnimation: StandardAnimation { property: "x"; duration: 350; to: sideStageRevealer.openedValue; easing.type: Easing.OutQuint }307 showAnimation: StandardAnimation { property: "x"; duration: 350; to: sideStageRevealer.openedValue; easing.type: Easing.OutQuint }
@@ -352,6 +352,40 @@
352 orientation: Qt.Horizontal352 orientation: Qt.Horizontal
353 }353 }
354354
355 Lockscreen {
356 id: lockscreen
357 hides: [launcher, panel.indicators, hud]
358 shown: false
359 enabled: true
360 showAnimation: StandardAnimation { property: "opacity"; to: 1 }
361 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
362 y: panel.panelHeight
363 x: required ? 0 : - width
364 width: parent.width
365 height: parent.height - panel.panelHeight
366 background: shell.background
367
368 onUnlocked: lockscreen.hide()
369 onCancel: greeter.show()
370
371 Component.onCompleted: LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
372 }
373
374 Connections {
375 target: LightDM.Greeter
376
377 onShowPrompt: {
378 // TODO: There's no better way for now to determine if its a PIN or a passphrase.
379 if (text == "PIN") {
380 lockscreen.alphaNumeric = false
381 } else {
382 lockscreen.alphaNumeric = true
383 }
384 lockscreen.placeholderText = "Please enter %1:".arg(text);
385 lockscreen.show();
386 }
387 }
388
355 Greeter {389 Greeter {
356 id: greeter390 id: greeter
357391
@@ -360,7 +394,6 @@
360 shown: true394 shown: true
361 showAnimation: StandardAnimation { property: "x"; to: greeterRevealer.openedValue }395 showAnimation: StandardAnimation { property: "x"; to: greeterRevealer.openedValue }
362 hideAnimation: StandardAnimation { property: "x"; to: greeterRevealer.closedValue }396 hideAnimation: StandardAnimation { property: "x"; to: greeterRevealer.closedValue }
363
364 y: panel.panelHeight397 y: panel.panelHeight
365 width: parent.width398 width: parent.width
366 height: parent.height - panel.panelHeight399 height: parent.height - panel.panelHeight
@@ -370,6 +403,11 @@
370403
371 onShownChanged: {404 onShownChanged: {
372 if (shown) {405 if (shown) {
406 // If there is only one user, we start authenticating with that one here.
407 // If there are more users, the Greeter will handle that
408 if (LightDM.Users.count == 1) {
409 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
410 }
373 greeter.forceActiveFocus();411 greeter.forceActiveFocus();
374 // FIXME: *FocusedApplication are not updated when unfocused, hence the need to check whether412 // FIXME: *FocusedApplication are not updated when unfocused, hence the need to check whether
375 // the stage was actually shown413 // the stage was actually shown
@@ -397,7 +435,7 @@
397435
398 InputFilterArea {436 InputFilterArea {
399 anchors.fill: parent437 anchors.fill: parent
400 blockInput: greeter.shown438 blockInput: greeter.shown || lockscreen.shown
401 }439 }
402440
403 Revealer {441 Revealer {
@@ -426,7 +464,7 @@
426 hides: [launcher]464 hides: [launcher]
427 }465 }
428 fullscreenMode: shell.fullscreenMode466 fullscreenMode: shell.fullscreenMode
429 searchVisible: !greeter.shown467 searchVisible: !greeter.shown && !lockscreen.shown
430468
431 InputFilterArea {469 InputFilterArea {
432 anchors.fill: parent470 anchors.fill: parent
@@ -440,7 +478,7 @@
440 width: parent.width > units.gu(60) ? units.gu(40) : parent.width478 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
441 height: parent.height479 height: parent.height
442480
443 available: !greeter.shown && !panel.indicators.shown481 available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown
444 shown: false482 shown: false
445 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }483 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
446 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }484 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
447485
=== modified file 'cmake/modules/QmlTest.cmake'
--- cmake/modules/QmlTest.cmake 2013-04-22 14:30:45 +0000
+++ cmake/modules/QmlTest.cmake 2013-06-03 18:14:27 +0000
@@ -23,7 +23,7 @@
2323
24macro(add_qml_test SUBPATH COMPONENT_NAME)24macro(add_qml_test SUBPATH COMPONENT_NAME)
25 set(options NO_ADD_TEST NO_TARGETS)25 set(options NO_ADD_TEST NO_TARGETS)
26 set(multi_value_keywords IMPORT_PATHS TARGETS PROPERTIES)26 set(multi_value_keywords IMPORT_PATHS TARGETS PROPERTIES ENVIRONMENT)
2727
28 cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN})28 cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN})
2929
@@ -44,6 +44,7 @@
44 endif()44 endif()
4545
46 set(qmltest_command46 set(qmltest_command
47 env ${qmltest_ENVIRONMENT}
47 ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml48 ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml
48 ${qmltestrunner_imports}49 ${qmltestrunner_imports}
49 -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml50 -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml
5051
=== modified file 'plugins/LightDM/CMakeLists.txt'
--- plugins/LightDM/CMakeLists.txt 2013-05-28 10:26:22 +0000
+++ plugins/LightDM/CMakeLists.txt 2013-06-03 18:14:27 +0000
@@ -40,4 +40,4 @@
4040
41install(FILES qmldir41install(FILES qmldir
42 DESTINATION ${SHELL_APP_DIR}/plugins/LightDM42 DESTINATION ${SHELL_APP_DIR}/plugins/LightDM
43 )
44\ No newline at end of file43\ No newline at end of file
44 )
4545
=== modified file 'run'
--- run 2013-05-28 09:32:03 +0000
+++ run 2013-06-03 18:14:27 +0000
@@ -4,6 +4,8 @@
4export LD_LIBRARY_PATH=$PWD/../unity_build/build/lib4export LD_LIBRARY_PATH=$PWD/../unity_build/build/lib
5GDB=false5GDB=false
6FAKE=false6FAKE=false
7PINLOCK=false
8KEYLOCK=false
7MOUSE_TOUCH=true9MOUSE_TOUCH=true
810
9usage() {11usage() {
@@ -11,6 +13,8 @@
11 echo "Script to run the shell.\n" >&213 echo "Script to run the shell.\n" >&2
12 echo "OPTIONS:" >&214 echo "OPTIONS:" >&2
13 echo " -f, --fake Force use of fake Qml modules." >&215 echo " -f, --fake Force use of fake Qml modules." >&2
16 echo " -p, --pinlock Use a pin protected user." >&2
17 echo " -k, --keylock Use a passphrase protected user." >&2
14 echo " -g, --gdb Run through gdb." >&218 echo " -g, --gdb Run through gdb." >&2
15 echo " -h, --help Show this help." >&219 echo " -h, --help Show this help." >&2
16 echo " -m, --nomousetouch Run without -mousetouch argument." >&220 echo " -m, --nomousetouch Run without -mousetouch argument." >&2
@@ -18,7 +22,7 @@
18 exit 122 exit 1
19}23}
2024
21ARGS=`getopt -n$0 -u -a --longoptions="fake,gdb,help,nomousetouch" -o "fghm" -- "$@"`25ARGS=`getopt -n$0 -u -a --longoptions="fake,pinlock,keylock,gdb,help,nomousetouch" -o "fghm" -- "$@"`
22[ $? -ne 0 ] && usage26[ $? -ne 0 ] && usage
23eval set -- "$ARGS"27eval set -- "$ARGS"
2428
@@ -26,6 +30,8 @@
26do30do
27 case "$1" in31 case "$1" in
28 -f|--fake) FAKE=true;;32 -f|--fake) FAKE=true;;
33 -p|--pinlock) PINLOCK=true;;
34 -k|--keylock) KEYLOCK=true;;
29 -g|--gdb) GDB=true;;35 -g|--gdb) GDB=true;;
30 -h|--help) usage;;36 -h|--help) usage;;
31 -m|--nomousetouch) MOUSE_TOUCH=false;;37 -m|--nomousetouch) MOUSE_TOUCH=false;;
@@ -36,7 +42,17 @@
3642
37if $FAKE; then43if $FAKE; then
38 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins44 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins
39 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/LightDM/full45 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/LightDM/single
46fi
47
48if $PINLOCK; then
49 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins
50 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/LightDM/single-pin
51fi
52
53if $KEYLOCK; then
54 export QML2_IMPORT_PATH=$PWD/builddir/tests/mocks:$PWD/builddir/plugins
55 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/builddir/tests/mocks/LightDM/single-passphrase
40fi56fi
4157
42# Force icon theme if running on the desktop, otherwise gnome theme (if running58# Force icon theme if running on the desktop, otherwise gnome theme (if running
4359
=== modified file 'run_on_device'
--- run_on_device 2013-05-29 08:21:31 +0000
+++ run_on_device 2013-06-03 18:14:27 +0000
@@ -11,6 +11,8 @@
11RUN_OPTIONS=-qmljsdebugger=port:$TARGET_DEBUG_PORT11RUN_OPTIONS=-qmljsdebugger=port:$TARGET_DEBUG_PORT
12SETUP=false12SETUP=false
13GDB=false13GDB=false
14PINLOCK=false
15KEYLOCK=false
14SUDO="echo $PASSWORD | sudo -S"16SUDO="echo $PASSWORD | sudo -S"
15NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))'17NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))'
1618
@@ -83,11 +85,20 @@
83 adb shell "chroot /data/ubuntu /usr/bin/service ubuntu-session restart"85 adb shell "chroot /data/ubuntu /usr/bin/service ubuntu-session restart"
84 fi86 fi
85 adb shell pkill $BINARY87 adb shell pkill $BINARY
88 ARGS="--nomousetouch"
86 if $GDB; then89 if $GDB; then
87 exec_with_ssh "cd $CODE_DIR/ && ./run --gdb --nomousetouch -- $RUN_OPTIONS"90 ARGS="$ARGS --gdb"
88 else91 fi
89 exec_with_ssh "cd $CODE_DIR && ./run --nomousetouch -- $RUN_OPTIONS"92 if $PINLOCK; then
90 fi93 ARGS="$ARGS -p"
94 fi
95 if $KEYLOCK; then
96 ARGS="$ARGS -k"
97 fi
98
99 echo "################################################### $ARGS"
100 exec_with_ssh "cd $CODE_DIR/ && ./run $ARGS -- $RUN_OPTIONS"
101
91 if [ $CONTAINS_SHELL -eq 0 ]; then102 if [ $CONTAINS_SHELL -eq 0 ]; then
92 echo "Restoring $SERVICEFILE on device from $SERVICEFILE.backup"103 echo "Restoring $SERVICEFILE on device from $SERVICEFILE.backup"
93 adb shell cp $SERVICEFILE.backup $SERVICEFILE104 adb shell cp $SERVICEFILE.backup $SERVICEFILE
@@ -95,7 +106,7 @@
95 fi106 fi
96}107}
97108
98set -- `getopt -n$0 -u -a --longoptions="setup,gdb,help" "sgh" "$@"`109set -- `getopt -n$0 -u -a --longoptions="setup,gdb,pinlock,keylock,help" "sgh" "$@"`
99110
100# FIXME: giving incorrect arguments does not call usage and exit111# FIXME: giving incorrect arguments does not call usage and exit
101while [ $# -gt 0 ]112while [ $# -gt 0 ]
@@ -103,6 +114,8 @@
103 case "$1" in114 case "$1" in
104 -s|--setup) SETUP=true;;115 -s|--setup) SETUP=true;;
105 -g|--gdb) GDB=true;;116 -g|--gdb) GDB=true;;
117 -p|--pinlock) PINLOCK=true;;
118 -k|--keylock) KEYLOCK=true;;
106 -h|--help) usage;;119 -h|--help) usage;;
107 --) shift;break;;120 --) shift;break;;
108 esac121 esac
109122
=== modified file 'tests/autopilot/qml_phone_shell/tests/__init__.py'
--- tests/autopilot/qml_phone_shell/tests/__init__.py 2013-05-31 00:55:24 +0000
+++ tests/autopilot/qml_phone_shell/tests/__init__.py 2013-06-03 18:14:27 +0000
@@ -23,6 +23,8 @@
2323
24 """A common test case class that provides several useful methods for shell tests."""24 """A common test case class that provides several useful methods for shell tests."""
2525
26 lightdm_mock = "full"
27
26 def setUp(self, geometry, grid_size):28 def setUp(self, geometry, grid_size):
27 super(ShellTestCase, self).setUp()29 super(ShellTestCase, self).setUp()
28 # Lets assume we are installed system wide if this file is somewhere in /usr30 # Lets assume we are installed system wide if this file is somewhere in /usr
@@ -37,7 +39,7 @@
37 self.launch_test_local(geometry)39 self.launch_test_local(geometry)
3840
39 def launch_test_local(self, geometry):41 def launch_test_local(self, geometry):
40 os.environ['LD_LIBRARY_PATH'] = "../../../unity_build/build/lib:../../builddir/tests/mocks/LightDM/full"42 os.environ['LD_LIBRARY_PATH'] = "../../../unity_build/build/lib:../../builddir/tests/mocks/LightDM/" + self.lightdm_mock
41 os.environ['QML2_IMPORT_PATH'] = "../../builddir/tests/mocks:../../builddir/plugins"43 os.environ['QML2_IMPORT_PATH'] = "../../builddir/tests/mocks:../../builddir/plugins"
42 if geometry != "0x0":44 if geometry != "0x0":
43 self.app = self.launch_test_application(45 self.app = self.launch_test_application(
@@ -47,7 +49,7 @@
47 "../../builddir/qml-phone-shell", "-fullscreen", app_type='qt')49 "../../builddir/qml-phone-shell", "-fullscreen", app_type='qt')
4850
49 def launch_test_installed(self, geometry):51 def launch_test_installed(self, geometry):
50 os.environ['LD_LIBRARY_PATH'] = "/usr/share/qml-phone-shell/plugins/mocks/LightDM/full"52 os.environ['LD_LIBRARY_PATH'] = "/usr/share/qml-phone-shell/plugins/mocks/LightDM/" + self.lightdm_mock
51 os.environ['QML2_IMPORT_PATH'] = "/usr/share/qml-phone-shell/plugins/mocks:/usr/share/qml-phone-shell/plugins"53 os.environ['QML2_IMPORT_PATH'] = "/usr/share/qml-phone-shell/plugins/mocks:/usr/share/qml-phone-shell/plugins"
52 if model() == 'Desktop' and geometry != "0x0":54 if model() == 'Desktop' and geometry != "0x0":
53 self.app = self.launch_test_application(55 self.app = self.launch_test_application(
5456
=== modified file 'tests/autopilot/qml_phone_shell/tests/testcases.py'
--- tests/autopilot/qml_phone_shell/tests/testcases.py 2013-05-24 16:49:38 +0000
+++ tests/autopilot/qml_phone_shell/tests/testcases.py 2013-06-03 18:14:27 +0000
@@ -52,15 +52,15 @@
5252
53 if model() == 'Desktop':53 if model() == 'Desktop':
54 scenarios = [54 scenarios = [
55 ('Nexus 4', dict(app_width=768, app_height=1280, grid_unit_px=18)),55 ('Nexus 4', dict(app_width=768, app_height=1280, grid_unit_px=18, lightdm_mock="single")),
56 ('Nexus 10', dict(app_width=2560, app_height=1600, grid_unit_px=20)),56 ('Nexus 10', dict(app_width=2560, app_height=1600, grid_unit_px=20, lightdm_mock="full")),
57# TODO: don't run fullscreen tests just yet as the VM is performing too badly for that. Enable this once57# TODO: don't run fullscreen tests just yet as the VM is performing too badly for that. Enable this once
58# Autopilot tests are running on bear metal.58# Autopilot tests are running on bear metal.
59# ('Fullscreen', dict(app_width=0, app_height=0, grid_unit_px=10)),59# ('Fullscreen', dict(app_width=0, app_height=0, grid_unit_px=10, lightdm_mock="full")),
60 ]60 ]
61 else:61 else:
62 scenarios = [62 scenarios = [
63 ('Fullscreen', dict(app_width=0, app_height=0, grid_unit_px=0)),63 ('Fullscreen', dict(app_width=0, app_height=0, grid_unit_px=0, lightdm_mock="single")),
64 ]64 ]
6565
66 def setUp(self):66 def setUp(self):
6767
=== modified file 'tests/mocks/LightDM/CMakeLists.txt'
--- tests/mocks/LightDM/CMakeLists.txt 2013-05-28 10:47:02 +0000
+++ tests/mocks/LightDM/CMakeLists.txt 2013-06-03 18:14:27 +0000
@@ -6,6 +6,9 @@
66
7add_subdirectory(demo)7add_subdirectory(demo)
8add_subdirectory(full)8add_subdirectory(full)
9add_subdirectory(single)
10add_subdirectory(single-pin)
11add_subdirectory(single-passphrase)
912
10include_directories(13include_directories(
11 ${CMAKE_CURRENT_SOURCE_DIR}14 ${CMAKE_CURRENT_SOURCE_DIR}
@@ -27,8 +30,10 @@
27# installed on the system. So we make sure we link to our full fake version30# installed on the system. So we make sure we link to our full fake version
28# At run time, we can point to whichever version we happen to be using via31# At run time, we can point to whichever version we happen to be using via
29# LD_LIBRARY_PATH.32# LD_LIBRARY_PATH.
33add_dependencies(MockLightDM-qml MockLightDM-full)
30target_link_libraries(MockLightDM-qml34target_link_libraries(MockLightDM-qml
31 MockLightDM-full35 -L${CMAKE_CURRENT_BINARY_DIR}/full
36 -llightdm-qt5-2
32 )37 )
3338
34qt5_use_modules(MockLightDM-qml Gui Qml)39qt5_use_modules(MockLightDM-qml Gui Qml)
3540
=== modified file 'tests/mocks/LightDM/demo/CMakeLists.txt'
--- tests/mocks/LightDM/demo/CMakeLists.txt 2013-05-28 10:47:02 +0000
+++ tests/mocks/LightDM/demo/CMakeLists.txt 2013-06-03 18:14:27 +0000
@@ -11,3 +11,4 @@
11add_library(MockLightDM-demo STATIC ${LibLightDM_SOURCES})11add_library(MockLightDM-demo STATIC ${LibLightDM_SOURCES})
1212
13qt5_use_modules(MockLightDM-demo Gui)13qt5_use_modules(MockLightDM-demo Gui)
14
1415
=== modified file 'tests/mocks/LightDM/demo/GreeterPrivate.cpp'
--- tests/mocks/LightDM/demo/GreeterPrivate.cpp 2013-05-23 18:07:17 +0000
+++ tests/mocks/LightDM/demo/GreeterPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -33,20 +33,13 @@
33{33{
34 Q_Q(Greeter);34 Q_Q(Greeter);
3535
36 if (authenticationUser == "guest") {36 authenticated = true;
37 authenticated = true;37 Q_EMIT q->authenticationComplete();
38 Q_EMIT q->authenticationComplete();
39 } else {
40 Q_EMIT q->showPrompt("Password:", Greeter::PromptTypeSecret);
41 }
42}38}
4339
44void GreeterPrivate::handleRespond(const QString &response)40void GreeterPrivate::handleRespond(const QString &response)
45{41{
46 Q_Q(Greeter);42 Q_UNUSED(response);
47
48 authenticated = (response == "password");
49 Q_EMIT q->authenticationComplete();
50}43}
5144
52}45}
5346
=== modified file 'tests/mocks/LightDM/demo/InfographicModelPrivate.cpp'
--- tests/mocks/LightDM/demo/InfographicModelPrivate.cpp 2013-06-03 11:37:02 +0000
+++ tests/mocks/LightDM/demo/InfographicModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -44,20 +44,10 @@
44 colours.push_back(QColor::fromRgbF(0.63, 0.53, 0.3));44 colours.push_back(QColor::fromRgbF(0.63, 0.53, 0.3));
45 colours.push_back(QColor::fromRgbF(0.89, 0.56, 0.31));45 colours.push_back(QColor::fromRgbF(0.89, 0.56, 0.31));
4646
47 colours.push_back(QColor::fromRgbF(0.17, 0.34, 0.36));
48 colours.push_back(QColor::fromRgbF(0.36, 0.54, 0.49));
49 colours.push_back(QColor::fromRgbF(0.65, 0.76, 0.64));
50
51 colours.push_back(QColor::fromRgbF(0.21, 0.38, 0.37));
52 colours.push_back(QColor::fromRgbF(0.35, 0.49, 0.5));
53 colours.push_back(QColor::fromRgbF(0.67, 0.75, 0.82));
54
55 InfographicColorTheme first(colours[0], colours[1], colours[2]);47 InfographicColorTheme first(colours[0], colours[1], colours[2]);
56 InfographicColorTheme second(colours[3], colours[4], colours[5]);48 InfographicColorTheme second(colours[3], colours[4], colours[5]);
57 InfographicColorTheme eighth(colours[6], colours[7], colours[8]);49 InfographicColorTheme eighth(colours[6], colours[7], colours[8]);
58 InfographicColorTheme ninth(colours[9], colours[10], colours[11]);50 InfographicColorTheme ninth(colours[9], colours[10], colours[11]);
59 InfographicColorTheme eleventh(colours[12], colours[13], colours[14]);
60 InfographicColorTheme twelfth(colours[15], colours[16], colours[17]);
6151
62 {52 {
63 QVariantList firstMonth;53 QVariantList firstMonth;
@@ -71,7 +61,7 @@
71 QSharedPointer<InfographicData> data(61 QSharedPointer<InfographicData> data(
72 new InfographicData("<b>52km</b> travelled", first, firstMonth,62 new InfographicData("<b>52km</b> travelled", first, firstMonth,
73 ninth, secondMonth, this));63 ninth, secondMonth, this));
74 m_fakeData.insert("anna", data);64 m_fakeData.insert("guest", data);
75 }65 }
7666
77 {67 {
@@ -86,7 +76,7 @@
86 QSharedPointer<InfographicData> data(76 QSharedPointer<InfographicData> data(
87 new InfographicData("<b>33</b> messages today", second,77 new InfographicData("<b>33</b> messages today", second,
88 firstMonth, eighth, secondMonth, this));78 firstMonth, eighth, secondMonth, this));
89 m_fakeData.insert("anna", data);79 m_fakeData.insert("guest", data);
90 }80 }
9181
92 {82 {
@@ -101,112 +91,7 @@
101 QSharedPointer<InfographicData> data(91 QSharedPointer<InfographicData> data(
102 new InfographicData("<b>69</b> minutes talk time", eighth,92 new InfographicData("<b>69</b> minutes talk time", eighth,
103 firstMonth, second, secondMonth, this));93 firstMonth, second, secondMonth, this));
104 m_fakeData.insert("anna", data);94 m_fakeData.insert("guest", data);
105 }
106
107 {
108 QVariantList firstMonth;
109 while (firstMonth.size() < 17)
110 firstMonth.push_back(QVariant(rand()));
111 while (firstMonth.size() < 31)
112 firstMonth.push_back(QVariant());
113 QVariantList secondMonth;
114 while (secondMonth.size() < 31)
115 secondMonth.push_back(QVariant(rand()));
116 QSharedPointer<InfographicData> data(
117 new InfographicData("<b>5km</b> travelled", ninth, firstMonth,
118 first, secondMonth, this));
119 m_fakeData.insert("lois", data);
120 }
121
122 {
123 QVariantList firstMonth;
124 while (firstMonth.size() < 17)
125 firstMonth.push_back(QVariant(rand()));
126 while (firstMonth.size() < 31)
127 firstMonth.push_back(QVariant());
128 QVariantList secondMonth;
129 while (secondMonth.size() < 31)
130 secondMonth.push_back(QVariant(rand()));
131 QSharedPointer<InfographicData> data(
132 new InfographicData("<b>33</b> messages today", eleventh,
133 firstMonth, twelfth, secondMonth, this));
134 m_fakeData.insert("lois", data);
135 }
136
137 {
138 QVariantList firstMonth;
139 while (firstMonth.size() < 17)
140 firstMonth.push_back(QVariant(rand()));
141 while (firstMonth.size() < 31)
142 firstMonth.push_back(QVariant());
143 QVariantList secondMonth;
144 while (secondMonth.size() < 31)
145 secondMonth.push_back(QVariant());
146 QSharedPointer<InfographicData> data(
147 new InfographicData("<b>19</b> minutes talk time", twelfth,
148 firstMonth, eleventh, secondMonth, this));
149 m_fakeData.insert("lois", data);
150 }
151
152 {
153 QVariantList firstMonth;
154 while (firstMonth.size() < 29)
155 firstMonth.push_back(QVariant(rand()));
156 while (firstMonth.size() < 31)
157 firstMonth.push_back(QVariant());
158 QVariantList secondMonth;
159 while (secondMonth.size() < 31)
160 secondMonth.push_back(QVariant(rand()));
161 QSharedPointer<InfographicData> data(
162 new InfographicData("<b>5km</b> travelled", first, firstMonth,
163 ninth, secondMonth, this));
164 m_fakeData.insert("toomas", data);
165 }
166
167 {
168 QVariantList firstMonth;
169 while (firstMonth.size() < 29)
170 firstMonth.push_back(QVariant(rand()));
171 while (firstMonth.size() < 31)
172 firstMonth.push_back(QVariant());
173 QVariantList secondMonth;
174 while (secondMonth.size() < 31)
175 secondMonth.push_back(QVariant(rand()));
176 QSharedPointer<InfographicData> data(
177 new InfographicData("<b>33</b> messages today", second,
178 firstMonth, eighth, secondMonth, this));
179 m_fakeData.insert("toomas", data);
180 }
181
182 {
183 QVariantList firstMonth;
184 while (firstMonth.size() < 29)
185 firstMonth.push_back(QVariant(rand()));
186 while (firstMonth.size() < 31)
187 firstMonth.push_back(QVariant());
188 QVariantList secondMonth;
189 while (secondMonth.size() < 31)
190 secondMonth.push_back(QVariant());
191 QSharedPointer<InfographicData> data(
192 new InfographicData("<b>19</b> minutes talk time", eighth,
193 firstMonth, second, secondMonth, this));
194 m_fakeData.insert("toomas", data);
195 }
196
197 {
198 QVariantList firstMonth;
199 while (firstMonth.size() < 15)
200 firstMonth.push_back(QVariant(rand()));
201 while (firstMonth.size() < 31)
202 firstMonth.push_back(QVariant());
203 QVariantList secondMonth;
204 while (secondMonth.size() < 31)
205 secondMonth.push_back(QVariant(rand()));
206 QSharedPointer<InfographicData> data(
207 new InfographicData("<b>6</b>hrs watching videos today",
208 eleventh, firstMonth, first, secondMonth, this));
209 m_fakeData.insert("empty-name", data);
210 }95 }
211}96}
21297
21398
=== modified file 'tests/mocks/LightDM/demo/UsersModelPrivate.cpp'
--- tests/mocks/LightDM/demo/UsersModelPrivate.cpp 2013-05-23 18:07:17 +0000
+++ tests/mocks/LightDM/demo/UsersModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -26,11 +26,7 @@
26{26{
27 entries =27 entries =
28 {28 {
29 { "anna", "Anna Olson", 0, 0, false, false, 0, 0 },29 { "guest", "Guest", 0, 0, false, false, 0, 0 },
30 { "lois", "Lois Mcqueen", 0, 0, false, false, 0, 0 },
31 { "lola", "Lola Chang", 0, 0, false, false, 0, 0 },
32 { "toomas", "Toomas Vilms", 0, 0, false, false, 0, 0 },
33 { "guest", "Guest", 0, 0, false, false, 0, 0 },
34 };30 };
35}31}
3632
3733
=== modified file 'tests/mocks/LightDM/full/GreeterPrivate.cpp'
--- tests/mocks/LightDM/full/GreeterPrivate.cpp 2013-05-24 13:48:29 +0000
+++ tests/mocks/LightDM/full/GreeterPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -53,6 +53,8 @@
53 if (authenticationUser == "no-password") {53 if (authenticationUser == "no-password") {
54 authenticated = true;54 authenticated = true;
55 Q_EMIT q->authenticationComplete();55 Q_EMIT q->authenticationComplete();
56 } else if (authenticationUser == "has-pin"){
57 Q_EMIT q->showPrompt("PIN", Greeter::PromptTypeSecret);
56 } else if (authenticationUser == "auth-error") {58 } else if (authenticationUser == "auth-error") {
57 authenticated = false;59 authenticated = false;
58 Q_EMIT q->authenticationComplete();60 Q_EMIT q->authenticationComplete();
@@ -85,7 +87,11 @@
85 return;87 return;
86 }88 }
8789
88 authenticated = (response == "password");90 if (authenticationUser == "has-pin") {
91 authenticated = (response == "1234");
92 } else {
93 authenticated = (response == "password");
94 }
89 Q_EMIT q->authenticationComplete();95 Q_EMIT q->authenticationComplete();
90}96}
9197
9298
=== modified file 'tests/mocks/LightDM/full/UsersModelPrivate.cpp'
--- tests/mocks/LightDM/full/UsersModelPrivate.cpp 2013-05-23 19:53:33 +0000
+++ tests/mocks/LightDM/full/UsersModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -27,6 +27,7 @@
27 entries =27 entries =
28 {28 {
29 { "has-password", "Has Password", 0, 0, false, false, 0, 0 },29 { "has-password", "Has Password", 0, 0, false, false, 0, 0 },
30 { "has-pin", "Has PIN", 0, 0, false, false, 0, 0 },
30 { "different-prompt", "Different Prompt", 0, 0, false, false, 0, 0 },31 { "different-prompt", "Different Prompt", 0, 0, false, false, 0, 0 },
31 { "no-password", "No Password", 0, 0, false, false, 0, 0 },32 { "no-password", "No Password", 0, 0, false, false, 0, 0 },
32 { "auth-error", "Auth Error", 0, 0, false, false, 0, 0 },33 { "auth-error", "Auth Error", 0, 0, false, false, 0, 0 },
3334
=== added directory 'tests/mocks/LightDM/single'
=== added directory 'tests/mocks/LightDM/single-passphrase'
=== added file 'tests/mocks/LightDM/single-passphrase/CMakeLists.txt'
--- tests/mocks/LightDM/single-passphrase/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-passphrase/CMakeLists.txt 2013-06-03 18:14:27 +0000
@@ -0,0 +1,21 @@
1set(LibLightDM_SOURCES
2 ../Greeter.cpp
3 ../UsersModel.cpp
4 ../InfographicModel.cpp
5 GreeterPrivate.cpp
6 UsersModelPrivate.cpp
7 InfographicModelPrivate.cpp
8 ${CMAKE_SOURCE_DIR}/plugins/Utils/qvariantlistmodel.cpp
9 )
10
11
12add_library(MockLightDM-single-passphrase SHARED ${LibLightDM_SOURCES})
13
14qt5_use_modules(MockLightDM-single-passphrase Gui)
15
16set_target_properties(MockLightDM-single-passphrase PROPERTIES
17 OUTPUT_NAME lightdm-qt5-2)
18
19install(TARGETS MockLightDM-single-passphrase
20 DESTINATION ${SHELL_APP_DIR}/plugins/mocks/LightDM/single-passphrase
21 )
022
=== added file 'tests/mocks/LightDM/single-passphrase/GreeterPrivate.cpp'
--- tests/mocks/LightDM/single-passphrase/GreeterPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-passphrase/GreeterPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */
18
19#include "../Greeter.h"
20#include "../GreeterPrivate.h"
21
22#include <QDebug>
23
24namespace QLightDM
25{
26
27GreeterPrivate::GreeterPrivate(Greeter* parent)
28 : authenticated(false),
29 authenticationUser(),
30 q_ptr(parent)
31{
32}
33
34void GreeterPrivate::handleAuthenticate()
35{
36 Q_Q(Greeter);
37
38 qDebug() << "handleAuthentication called!" << authenticationUser;
39
40 Q_EMIT q->showPrompt("Password:", Greeter::PromptTypeSecret);
41}
42
43void GreeterPrivate::handleRespond(const QString &response)
44{
45 Q_Q(Greeter);
46
47
48 authenticated = (response == "password");
49 qDebug() << "responding" << response << authenticated;
50 Q_EMIT q->authenticationComplete();
51}
52
53}
054
=== added file 'tests/mocks/LightDM/single-passphrase/InfographicModelPrivate.cpp'
--- tests/mocks/LightDM/single-passphrase/InfographicModelPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-passphrase/InfographicModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,61 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#include "../InfographicModelPrivate.h"
20
21namespace QLightDM
22{
23
24void InfographicModelPrivate::generateFakeData()
25{
26 std::default_random_engine generator;
27 std::normal_distribution<qreal> distribution(0.5, 0.2);
28 auto rand = std::bind(distribution, generator);
29
30 QColor orange = QColor::fromRgbF(0.9, 0.3, 0.1, 1.0);
31 QColor yellow = QColor::fromRgbF(1.0, 0.6, 0.0, 1.0);
32 QColor red = QColor::fromRgbF(0.8, 0.0, 0.0, 1.0);
33 QColor darkPurple = QColor::fromRgbF(0.5, 0.2, 0.3, 1.0);
34 QColor lightPurple = QColor::fromRgbF(0.8, 0.1, 0.8, 1.0);
35 QColor pink(QColor::fromRgbF(0.75, 0.13, 0.75));
36
37 InfographicColorTheme orangeTheme(orange, orange, orange);
38 InfographicColorTheme yellowTheme(yellow, yellow, yellow);
39 InfographicColorTheme redTheme(red, red, red);
40 InfographicColorTheme darkPurpleTheme(darkPurple, darkPurple, darkPurple);
41 InfographicColorTheme lightPurpleTheme(lightPurple, lightPurple,
42 lightPurple);
43 InfographicColorTheme pinkTheme(pink, pink, pink);
44
45 {
46 QVariantList firstMonth;
47 while (firstMonth.size() < 17)
48 firstMonth.push_back(QVariant(rand()));
49 while (firstMonth.size() < 31)
50 firstMonth.push_back(QVariant());
51 QVariantList secondMonth;
52 while (secondMonth.size() < 31)
53 secondMonth.push_back(QVariant(rand()));
54 QSharedPointer<InfographicData> data(
55 new InfographicData("<b>5km</b> travelled", yellowTheme,
56 firstMonth, orangeTheme, secondMonth, this));
57 m_fakeData.insert("has-pin", data);
58 }
59}
60
61}
062
=== added file 'tests/mocks/LightDM/single-passphrase/UsersModelPrivate.cpp'
--- tests/mocks/LightDM/single-passphrase/UsersModelPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-passphrase/UsersModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */
18
19#include "../UsersModelPrivate.h"
20
21namespace QLightDM
22{
23
24UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
25 : q_ptr(parent)
26{
27 entries =
28 {
29 { "has-pin", "Has PIN", 0, 0, false, false, 0, 0 },
30 };
31}
32
33}
034
=== added directory 'tests/mocks/LightDM/single-pin'
=== added file 'tests/mocks/LightDM/single-pin/CMakeLists.txt'
--- tests/mocks/LightDM/single-pin/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-pin/CMakeLists.txt 2013-06-03 18:14:27 +0000
@@ -0,0 +1,21 @@
1set(LibLightDM_SOURCES
2 ../Greeter.cpp
3 ../UsersModel.cpp
4 ../InfographicModel.cpp
5 GreeterPrivate.cpp
6 UsersModelPrivate.cpp
7 InfographicModelPrivate.cpp
8 ${CMAKE_SOURCE_DIR}/plugins/Utils/qvariantlistmodel.cpp
9 )
10
11
12add_library(MockLightDM-single-pin SHARED ${LibLightDM_SOURCES})
13
14qt5_use_modules(MockLightDM-single-pin Gui)
15
16set_target_properties(MockLightDM-single-pin PROPERTIES
17 OUTPUT_NAME lightdm-qt5-2)
18
19install(TARGETS MockLightDM-single-pin
20 DESTINATION ${SHELL_APP_DIR}/plugins/mocks/LightDM/single-pin
21 )
022
=== added file 'tests/mocks/LightDM/single-pin/GreeterPrivate.cpp'
--- tests/mocks/LightDM/single-pin/GreeterPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-pin/GreeterPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */
18
19#include "../Greeter.h"
20#include "../GreeterPrivate.h"
21
22#include <QDebug>
23
24namespace QLightDM
25{
26
27GreeterPrivate::GreeterPrivate(Greeter* parent)
28 : authenticated(false),
29 authenticationUser(),
30 q_ptr(parent)
31{
32}
33
34void GreeterPrivate::handleAuthenticate()
35{
36 Q_Q(Greeter);
37
38 qDebug() << "handleAuthentication called!" << authenticationUser;
39
40 Q_EMIT q->showPrompt("PIN:", Greeter::PromptTypeSecret);
41}
42
43void GreeterPrivate::handleRespond(const QString &response)
44{
45 Q_Q(Greeter);
46
47
48 authenticated = (response == "1234");
49 qDebug() << "responding" << response << authenticated;
50 Q_EMIT q->authenticationComplete();
51}
52
53}
054
=== added file 'tests/mocks/LightDM/single-pin/InfographicModelPrivate.cpp'
--- tests/mocks/LightDM/single-pin/InfographicModelPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-pin/InfographicModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,61 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#include "../InfographicModelPrivate.h"
20
21namespace QLightDM
22{
23
24void InfographicModelPrivate::generateFakeData()
25{
26 std::default_random_engine generator;
27 std::normal_distribution<qreal> distribution(0.5, 0.2);
28 auto rand = std::bind(distribution, generator);
29
30 QColor orange = QColor::fromRgbF(0.9, 0.3, 0.1, 1.0);
31 QColor yellow = QColor::fromRgbF(1.0, 0.6, 0.0, 1.0);
32 QColor red = QColor::fromRgbF(0.8, 0.0, 0.0, 1.0);
33 QColor darkPurple = QColor::fromRgbF(0.5, 0.2, 0.3, 1.0);
34 QColor lightPurple = QColor::fromRgbF(0.8, 0.1, 0.8, 1.0);
35 QColor pink(QColor::fromRgbF(0.75, 0.13, 0.75));
36
37 InfographicColorTheme orangeTheme(orange, orange, orange);
38 InfographicColorTheme yellowTheme(yellow, yellow, yellow);
39 InfographicColorTheme redTheme(red, red, red);
40 InfographicColorTheme darkPurpleTheme(darkPurple, darkPurple, darkPurple);
41 InfographicColorTheme lightPurpleTheme(lightPurple, lightPurple,
42 lightPurple);
43 InfographicColorTheme pinkTheme(pink, pink, pink);
44
45 {
46 QVariantList firstMonth;
47 while (firstMonth.size() < 17)
48 firstMonth.push_back(QVariant(rand()));
49 while (firstMonth.size() < 31)
50 firstMonth.push_back(QVariant());
51 QVariantList secondMonth;
52 while (secondMonth.size() < 31)
53 secondMonth.push_back(QVariant(rand()));
54 QSharedPointer<InfographicData> data(
55 new InfographicData("<b>5km</b> travelled", yellowTheme,
56 firstMonth, orangeTheme, secondMonth, this));
57 m_fakeData.insert("has-pin", data);
58 }
59}
60
61}
062
=== added file 'tests/mocks/LightDM/single-pin/UsersModelPrivate.cpp'
--- tests/mocks/LightDM/single-pin/UsersModelPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single-pin/UsersModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */
18
19#include "../UsersModelPrivate.h"
20
21namespace QLightDM
22{
23
24UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
25 : q_ptr(parent)
26{
27 entries =
28 {
29 { "has-pin", "Has PIN", 0, 0, false, false, 0, 0 },
30 };
31}
32
33}
034
=== added file 'tests/mocks/LightDM/single/CMakeLists.txt'
--- tests/mocks/LightDM/single/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single/CMakeLists.txt 2013-06-03 18:14:27 +0000
@@ -0,0 +1,20 @@
1set(LibLightDM_SOURCES
2 ../Greeter.cpp
3 ../InfographicModel.cpp
4 ../UsersModel.cpp
5 GreeterPrivate.cpp
6 InfographicModelPrivate.cpp
7 UsersModelPrivate.cpp
8 ${CMAKE_SOURCE_DIR}/plugins/Utils/qvariantlistmodel.cpp
9 )
10
11add_library(MockLightDM-single SHARED ${LibLightDM_SOURCES})
12
13qt5_use_modules(MockLightDM-single Gui)
14
15set_target_properties(MockLightDM-single PROPERTIES
16 OUTPUT_NAME lightdm-qt5-2)
17
18install(TARGETS MockLightDM-single
19 DESTINATION ${SHELL_APP_DIR}/plugins/mocks/LightDM/single
20 )
021
=== added file 'tests/mocks/LightDM/single/GreeterPrivate.cpp'
--- tests/mocks/LightDM/single/GreeterPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single/GreeterPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */
18
19#include "../Greeter.h"
20#include "../GreeterPrivate.h"
21
22namespace QLightDM
23{
24
25GreeterPrivate::GreeterPrivate(Greeter* parent)
26 : authenticated(false),
27 authenticationUser(),
28 twoFactorDone(false),
29 q_ptr(parent)
30{
31}
32
33void GreeterPrivate::handleAuthenticate()
34{
35 Q_Q(Greeter);
36
37 if (authenticationUser == "one") {
38 authenticated = true;
39 Q_EMIT q->authenticationComplete();
40 }
41}
42
43void GreeterPrivate::handleRespond(QString const &response)
44{
45 Q_UNUSED(response)
46}
47
48}
049
=== added file 'tests/mocks/LightDM/single/InfographicModelPrivate.cpp'
--- tests/mocks/LightDM/single/InfographicModelPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single/InfographicModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#include "../InfographicModelPrivate.h"
20
21namespace QLightDM
22{
23
24void InfographicModelPrivate::generateFakeData()
25{
26}
27
28}
029
=== added file 'tests/mocks/LightDM/single/UsersModelPrivate.cpp'
--- tests/mocks/LightDM/single/UsersModelPrivate.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/LightDM/single/UsersModelPrivate.cpp 2013-06-03 18:14:27 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */
18
19#include "../UsersModelPrivate.h"
20
21namespace QLightDM
22{
23
24UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
25 : q_ptr(parent)
26{
27 entries =
28 {
29 { "one", "Only User", 0, 0, false, false, 0, 0 },
30 };
31}
32
33}
034
=== modified file 'tests/qmltests/CMakeLists.txt'
--- tests/qmltests/CMakeLists.txt 2013-06-03 11:35:43 +0000
+++ tests/qmltests/CMakeLists.txt 2013-06-03 18:14:27 +0000
@@ -45,8 +45,12 @@
45 ${CMAKE_BINARY_DIR}/tests/mocks)45 ${CMAKE_BINARY_DIR}/tests/mocks)
46add_qml_test(Dash/Apps RunningApplicationsGrid IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)46add_qml_test(Dash/Apps RunningApplicationsGrid IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
47add_qml_test(Dash/People PeopleFilterGrid IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_CURRENT_SOURCE_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})47add_qml_test(Dash/People PeopleFilterGrid IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_CURRENT_SOURCE_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS})
48add_qml_test(Greeter Greeter IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/mocks48add_qml_test(Greeter Lockscreen IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/mocks
49 PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")49 PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
50add_qml_test(Greeter Tablet IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/mocks
51 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
52add_qml_test(Greeter Phone IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/mocks
53 ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single")
50add_qml_test(Greeter Infographics IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)54add_qml_test(Greeter Infographics IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/plugins)
51add_qml_test(Hud Hud)55add_qml_test(Hud Hud)
52add_qml_test(Hud Result)56add_qml_test(Hud Result)
5357
=== added file 'tests/qmltests/Greeter/tst_Lockscreen.qml'
--- tests/qmltests/Greeter/tst_Lockscreen.qml 1970-01-01 00:00:00 +0000
+++ tests/qmltests/Greeter/tst_Lockscreen.qml 2013-06-03 18:14:27 +0000
@@ -0,0 +1,205 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtTest 1.0
19import ".."
20import "../../../Greeter"
21import Ubuntu.Components 0.1
22import LightDM 0.1 as LightDM
23import Unity.Test 0.1 as UT
24
25Rectangle {
26 width: units.gu(60)
27 height: units.gu(80)
28 color: "orange"
29
30 Lockscreen {
31 id: lockscreen
32 anchors.fill: parent
33 anchors.rightMargin: units.gu(18)
34 placeholderText: "Please enter your PIN"
35 alphaNumeric: pinPadCheckBox.checked
36 pinLength: pinLengthTextField.text
37 username: "Lola"
38 }
39
40 Connections {
41 target: lockscreen
42
43 onEmergencyCall: emergencyCheckBox.checked = true
44 onUnlocked: unlockedCheckBox.checked = true
45 }
46
47 Connections {
48 target: LightDM.Greeter
49
50 onShowPrompt: {
51 if (text.indexOf("PIN") >= 0) {
52 lockscreen.alphaNumeric = false
53 } else {
54 lockscreen.alphaNumeric = true
55 }
56 lockscreen.placeholderText = text;
57 }
58 }
59
60 Rectangle {
61 anchors.fill: parent
62 anchors.leftMargin: lockscreen.width
63 color: "lightgray"
64
65 Column {
66 anchors.fill: parent
67 anchors.margins: units.gu(1)
68
69 Row {
70 CheckBox {
71 id: pinPadCheckBox
72 }
73 Label {
74 text: "Alphanumeric"
75 anchors.verticalCenter: parent.verticalCenter
76 }
77 }
78 Row {
79 CheckBox {
80 id: emergencyCheckBox
81 }
82 Label {
83 text: "Emergency Call"
84 anchors.verticalCenter: parent.verticalCenter
85 }
86 }
87 Row {
88 TextField {
89 id: pinLengthTextField
90 width: units.gu(7)
91 text: "4"
92 }
93 Label {
94 text: "PIN length"
95 }
96 }
97 Label {
98 id: pinLabel
99 anchors.verticalCenter: parent.verticalCenter
100 }
101 Row {
102 CheckBox {
103 id: unlockedCheckBox
104 }
105 Label {
106 text: "Unlocked signal"
107 anchors.verticalCenter: parent.verticalCenter
108 }
109 }
110 Button {
111 text: "start auth (1234)"
112 onClicked: LightDM.Greeter.authenticate("has-pin")
113 }
114 Button {
115 text: "start auth (password)"
116 onClicked: LightDM.Greeter.authenticate("has-password")
117 }
118 }
119 }
120
121 UT.UnityTestCase {
122 name: "Lockscreen"
123 when: windowShown
124
125 function test_loading_data() {
126 return [
127 {tag: "numeric", alphanumeric: false, pinPadAvailable: true },
128 {tag: "alphanumeric", alphanumeric: true, pinPadAvailable: false }
129 ]
130 }
131
132 function test_loading(data) {
133 lockscreen.alphaNumeric = data.alphanumeric
134 waitForRendering(lockscreen)
135 if (data.pinPadAvailable) {
136 compare(findChild(lockscreen, "pinPadButton8").text, "8", "Could not find number 8 on PinPad")
137 } else {
138 compare(findChild(lockscreen, "pinPadButton8"), undefined, "Could find number 8 on PinPad even though it should be only OSK")
139 }
140 }
141
142 function test_emergency_call_data() {
143 return [
144 {tag: "numeric", alphanumeric: false },
145 {tag: "alphanumeric", alphanumeric: true }
146 ]
147 }
148
149 function test_emergency_call(data) {
150 emergencyCheckBox.checked = false
151 lockscreen.alphaNumeric = data.alphanumeric
152 waitForRendering(lockscreen)
153 var emergencyButton = findChild(lockscreen, "emergencyCallIcon")
154 mouseClick(emergencyButton, units.gu(1), units.gu(1))
155 tryCompare(emergencyCheckBox, "checked", true)
156
157 }
158
159 function test_labels_data() {
160 return [
161 {tag: "numeric", alphanumeric: false, placeholderText: "Please enter your PIN", username: "foobar" },
162 {tag: "alphanumeric", alphanumeric: true, placeholderText: "Please enter your password", username: "Lola" }
163 ]
164 }
165
166 function test_labels(data) {
167 lockscreen.alphaNumeric = data.alphanumeric
168 lockscreen.placeholderText = data.placeholderText
169 waitForRendering(lockscreen)
170 compare(findChild(lockscreen, "pinentryField").placeholderText, data.placeholderText, "Placeholdertext is not what it should be")
171 if (data.alphanumeric) {
172 compare(findChild(lockscreen, "greeterLabel").text, "Hello " + data.username, "Greeter is not set correctly")
173 }
174 }
175
176
177 function test_unlock_data() {
178 return [
179 {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true},
180 {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", unlockedSignal: true},
181 {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", unlockedSignal: false},
182 {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", unlockedSignal: false},
183 ]
184 }
185
186 function test_unlock(data) {
187 unlockedCheckBox.checked = false
188 LightDM.Greeter.authenticate(data.username)
189
190 if (data.alphanumeric) {
191 var inputField = findChild(lockscreen, "pinentryField")
192 mouseClick(inputField, units.gu(1), units.gu(1))
193 typeString(data.password)
194 keyClick(Qt.Key_Enter)
195 } else {
196 for (var i = 0; i < data.password.length; ++i) {
197 var character = data.password.charAt(i)
198 var button = findChild(lockscreen, "pinPadButton" + character)
199 mouseClick(button, units.gu(1), units.gu(1))
200 }
201 }
202 tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
203 }
204 }
205}
0206
=== added file 'tests/qmltests/Greeter/tst_Phone.qml'
--- tests/qmltests/Greeter/tst_Phone.qml 1970-01-01 00:00:00 +0000
+++ tests/qmltests/Greeter/tst_Phone.qml 2013-06-03 18:14:27 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtTest 1.0
19import ".."
20import "../../../Greeter"
21import Ubuntu.Components 0.1
22import LightDM 0.1 as LightDM
23import Unity.Test 0.1 as UT
24
25Item {
26 width: units.gu(60)
27 height: units.gu(80)
28
29 Greeter {
30 id: greeter
31 anchors.fill: parent
32 }
33
34 SignalSpy {
35 id: unlockSpy
36 target: greeter
37 signalName: "unlocked"
38 }
39
40 UT.UnityTestCase {
41 name: "Greeter"
42 when: windowShown
43
44 function test_properties() {
45 compare(greeter.multiUser, false)
46 compare(greeter.narrowMode, true)
47 }
48
49 function test_teasingArea() {
50 tryCompare(greeter, "leftTeaserPressed", false)
51 mousePress(greeter, units.gu(2), greeter.height - units.gu(1))
52 tryCompare(greeter, "leftTeaserPressed", true)
53 mouseRelease(greeter, units.gu(2), greeter.height - units.gu(1))
54 tryCompare(greeter, "leftTeaserPressed", false)
55
56 mousePress(greeter, greeter.width - units.gu(2), greeter.height - units.gu(1))
57 tryCompare(greeter, "leftTeaserPressed", false)
58 mouseRelease(greeter, units.gu(2), greeter.height - units.gu(1))
59 tryCompare(greeter, "leftTeaserPressed", false)
60 }
61 }
62}
063
=== renamed file 'tests/qmltests/Greeter/tst_Greeter.qml' => 'tests/qmltests/Greeter/tst_Tablet.qml'
--- tests/qmltests/Greeter/tst_Greeter.qml 2013-06-03 11:35:43 +0000
+++ tests/qmltests/Greeter/tst_Tablet.qml 2013-06-03 18:14:27 +0000
@@ -79,6 +79,11 @@
79 return i79 return i
80 }80 }
8181
82 function test_properties() {
83 compare(greeter.multiUser, true)
84 compare(greeter.narrowMode, false)
85 }
86
82 function test_cycle_data() {87 function test_cycle_data() {
83 var data = new Array()88 var data = new Array()
84 for (var i = 0; i < greeter.model.count; i++) {89 for (var i = 0; i < greeter.model.count; i++) {
@@ -148,19 +153,6 @@
148 fail("Didn't find empty-name")153 fail("Didn't find empty-name")
149 }154 }
150155
151 function test_teasingArea() {
152 tryCompare(greeter, "leftTeaserPressed", false)
153 mousePress(greeter, units.gu(2), greeter.height - units.gu(1))
154 tryCompare(greeter, "leftTeaserPressed", true)
155 mouseRelease(greeter, units.gu(2), greeter.height - units.gu(1))
156 tryCompare(greeter, "leftTeaserPressed", false)
157
158 mousePress(greeter, greeter.width - units.gu(2), greeter.height - units.gu(1))
159 tryCompare(greeter, "leftTeaserPressed", false)
160 mouseRelease(greeter, units.gu(2), greeter.height - units.gu(1))
161 tryCompare(greeter, "leftTeaserPressed", false)
162 }
163
164 function test_auth_error() {156 function test_auth_error() {
165 select_user("auth-error")157 select_user("auth-error")
166 var passwordInput = findChild(greeter, "passwordInput")158 var passwordInput = findChild(greeter, "passwordInput")

Subscribers

People subscribed via source and target branches