on xenial help sign in
More nits
015ad2dMichael Terry
qml/Greeter/CoverPage.qml−1
@@ -26,7 +26,6 @@ Showable {
26 property real launcherOffset
26 property real launcherOffset
27 property alias background: greeterBackground.source
27 property alias background: greeterBackground.source
28 property real backgroundTopMargin
28 property real backgroundTopMargin
29− property bool ready: greeterBackground.source == "" || greeterBackground.status == Image.Ready || greeterBackground.status == Image.Error
30 property var infographicModel
29 property var infographicModel
31 property bool draggable: true
30 property bool draggable: true
32
31
tests/qmltests/Greeter/tst_Greeter.qml+24−4
@@ -357,11 +357,31 @@ Item {
357 function test_laucherOffsetAnimation() {
357 function test_laucherOffsetAnimation() {
358 // Our logic for smoothing launcherOffset when it suddenly goes to
358 // Our logic for smoothing launcherOffset when it suddenly goes to
359 // zero is a bit complicated. Let's just make sure it works here.
359 // zero is a bit complicated. Let's just make sure it works here.
360+
361+ launcherOffsetWatcher.target = view;
362+
363+ // should follow immediately
364+ launcherOffsetWatcher.values = [];
360− greeter.launcherOffset = 5;
365+ greeter.launcherOffset = 100;
361− compare(view.launcherOffset, 5);
366+ compare(view.launcherOffset, 100);
367+ compare(launcherOffsetWatcher.values.length, 1);
368+
369+ // should interpolate values until it reaches 0
370+ launcherOffsetWatcher.values = [];
362 greeter.launcherOffset = 0;
371 greeter.launcherOffset = 0;
363− compare(view.launcherOffset, 5); // initially stays at full value
364− tryCompare(view, "launcherOffset", 0); // and we animate down to 0
372+ tryCompare(view, "launcherOffset", 0);
373+ verify(launcherOffsetWatcher.values.length > 1);
374+ for (var i = 0; i < launcherOffsetWatcher.values.length - 1; ++i) {
375+ verify(launcherOffsetWatcher.values[i] > 0.0);
376+ verify(launcherOffsetWatcher.values[i] < 100.0);
377+ }
378+ }
379+ Connections {
380+ id: launcherOffsetWatcher
381+ property var values: []
382+ onLauncherOffsetChanged: {
383+ values.push(target.launcherOffset);
384+ }
365 }
385 }
366
386
367 function test_backgroundTopMargin() {
387 function test_backgroundTopMargin() {
tests/qmltests/tst_Shell.qml+14−1
@@ -23,6 +23,7 @@ import AccountsService 0.1
23import GSettings 1.0
23import GSettings 1.0
24import LightDM 0.1 as LightDM
24import LightDM 0.1 as LightDM
25import Ubuntu.Components 1.1
25import Ubuntu.Components 1.1
26+import Ubuntu.Components.ListItems 1.0 as ListItem
26import Ubuntu.Telephony 0.1 as Telephony
27import Ubuntu.Telephony 0.1 as Telephony
27import Unity.Application 0.1
28import Unity.Application 0.1
28import Unity.Connectivity 0.1
29import Unity.Connectivity 0.1
@@ -81,7 +82,7 @@ Item {
81 }
82 }
82
83
83 Rectangle {
84 Rectangle {
84− color: "white"
85+ color: "darkgrey"
85 width: units.gu(30)
86 width: units.gu(30)
86 height: shellLoader.height
87 height: shellLoader.height
87
88
@@ -104,6 +105,18 @@ Item {
104 }
105 }
105 }
106 }
106 }
107 }
108+ ListItem.ItemSelector {
109+ anchors { left: parent.left; right: parent.right }
110+ activeFocusOnPress: false
111+ text: "LightDM mock mode"
112+ model: ["single", "single-passphrase", "single-pin"]
113+ onSelectedIndexChanged: {
114+ shellLoader.active = false;
115+ LightDM.Greeter.mockMode = model[selectedIndex];
116+ LightDM.Users.mockMode = model[selectedIndex];
117+ shellLoader.active = true;
118+ }
119+ }
107 }
120 }
108 }
121 }
109 }
122 }
tests/qmltests/tst_ShellWithPassphrase.qmldeleted−136
@@ -1,136 +0,0 @@
1−/*
2− * Copyright (C) 2015 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−
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
19−import QtTest 1.0
20−import LightDM 0.1 as LightDM
21−import Unity.Application 0.1
22−import Unity.Test 0.1 as UT
23−
24−import "../../qml"
25−
26−Item {
27− id: root
28− width: contentRow.width
29− height: contentRow.height
30−
31− Component.onCompleted: {
32− // must set the mock mode before loading the Shell
33− LightDM.Greeter.mockMode = "single-passphrase";
34− LightDM.Users.mockMode = "single-passphrase";
35− shellLoader.active = true;
36− }
37−
38− QtObject {
39− id: applicationArguments
40−
41− function hasGeometry() {
42− return false;
43− }
44−
45− function width() {
46− return 0;
47− }
48−
49− function height() {
50− return 0;
51− }
52− }
53−
54− Row {
55− id: contentRow
56−
57− Loader {
58− id: shellLoader
59− active: false
60−
61− width: units.gu(40)
62− height: units.gu(71)
63−
64− property bool itemDestroyed: false
65− sourceComponent: Component {
66− Shell {
67− property string indicatorProfile: "phone"
68−
69− Component.onDestruction: {
70− shellLoader.itemDestroyed = true;
71− }
72− }
73− }
74− }
75−
76− Rectangle {
77− color: "white"
78− width: units.gu(30)
79− height: shellLoader.height
80−
81− Column {
82− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
83− spacing: units.gu(1)
84− Button {
85− anchors { left: parent.left; right: parent.right }
86− text: "Show Greeter"
87− onClicked: LightDM.Greeter.showGreeter()
88− }
89− }
90− }
91− }
92−
93− UT.UnityTestCase {
94− id: testCase
95− name: "ShellWithPassphrase"
96− when: windowShown
97−
98− property Item shell: shellLoader.status === Loader.Ready ? shellLoader.item : null
99−
100− function init() {
101− tryCompare(shell, "enabled", true); // will be enabled when greeter is all ready
102− }
103−
104− function cleanup() {
105− tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
106−
107− shellLoader.itemDestroyed = false;
108− shellLoader.active = false;
109− tryCompare(shellLoader, "status", Loader.Null);
110− tryCompare(shellLoader, "item", null);
111− // Loader.status might be Loader.Null and Loader.item might be null but the Loader
112− // item might still be alive. So if we set Loader.active back to true
113− // again right now we will get the very same Shell instance back. So no reload
114− // actually took place. Likely because Loader waits until the next event loop
115− // iteration to do its work. So to ensure the reload, we will wait until the
116− // Shell instance gets destroyed.
117− tryCompare(shellLoader, "itemDestroyed", true);
118−
119− killApps();
120− LightDM.Greeter.authenticate(""); // reset greeter
121−
122− // reload our test subject to get it in a fresh state once again
123− shellLoader.active = true;
124− tryCompare(shellLoader, "status", Loader.Ready);
125− removeTimeConstraintsFromDirectionalDragAreas(shellLoader.item);
126− }
127−
128− function killApps() {
129− while (ApplicationManager.count > 1) {
130− var appIndex = ApplicationManager.get(0).appId == "unity8-dash" ? 1 : 0;
131− ApplicationManager.stopApplication(ApplicationManager.get(appIndex).appId);
132− }
133− compare(ApplicationManager.count, 1);
134− }
135− }
136−}