Merge lp:~cimi/unity8/fix-1231731 into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Michael Zanetti
Approved revision: 471
Merged at revision: 509
Proposed branch: lp:~cimi/unity8/fix-1231731
Merge into: lp:unity8
Diff against target: 242 lines (+84/-20)
8 files modified
Greeter/Greeter.qml (+1/-0)
Greeter/GreeterContent.qml (+12/-9)
Greeter/Lockscreen.qml (+8/-4)
Shell.qml (+4/-0)
tests/autopilot/unity8/shell/emulators/main_window.py (+6/-0)
tests/autopilot/unity8/shell/tests/test_greeter.py (+38/-0)
tests/qmltests/Greeter/tst_Phone.qml (+5/-5)
tests/qmltests/tst_Shell.qml (+10/-2)
To merge this branch: bzr merge lp:~cimi/unity8/fix-1231731
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michael Zanetti (community) Approve
Albert Astals Cid (community) Approve
Review via email: mp+191414@code.launchpad.net

Commit message

Shifts wallpaper rendering for greeter lockscreen to be inline with shell

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:467
http://jenkins.qa.ubuntu.com/job/unity8-ci/1428/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/5056
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/2996/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2296
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/451
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1428
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1428/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1427
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1225
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/931
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/931/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2998
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/2998/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2503/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2547
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/16
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/14

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1428/rebuild

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

FAILED: Continuous integration, rev:467
http://jenkins.qa.ubuntu.com/job/unity8-ci/1433/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/5065
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/3004
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2301
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/456
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1433
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1433/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1432
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1233
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/940
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/940/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3006
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3006/artifact/work/output/*zip*/output.zip
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2511
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2555
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/32
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/28

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1433/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Do you think makes sense to add an autotest that checks that the height, width, x, y of the greeter CrossFadeImage background image and the dash CrossFadeImage background image are the same?

review: Needs Information
Revision history for this message
Andrea Cimitan (cimi) wrote :

> Do you think makes sense to add an autotest that checks that the height,
> width, x, y of the greeter CrossFadeImage background image and the dash
> CrossFadeImage background image are the same?

it does, you need to fire up the whole shell though (greeter needs reference to panel)
maybe autopilot is easier?

Revision history for this message
Albert Astals Cid (aacid) wrote :

No strong preference for qmltest/autopilot test, whatever you think it's easier :-)

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

I don't think you should access the "panel" in here. This will break once the Greeter is split out from the shell. Make it a property (e.g. topMargin) which you set from a place where the panel is available for real.

review: Needs Information
Revision history for this message
Andrea Cimitan (cimi) wrote :

> I don't think you should access the "panel" in here. This will break once the
> Greeter is split out from the shell. Make it a property (e.g. topMargin) which
> you set from a place where the panel is available for real.

valid point

lp:~cimi/unity8/fix-1231731 updated
468. By Andrea Cimitan

Added test for greeter wallpaper, changed some names from wallpaper->background

469. By Andrea Cimitan

Added property for backgroundTopMargin

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

FAILED: Continuous integration, rev:468
http://jenkins.qa.ubuntu.com/job/unity8-ci/1471/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/5129
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/3150/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2343
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/494
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1475
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1475/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1470
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1293
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/1004
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/1004/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3152
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3152/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2630/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2681/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/291
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/290

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1471/rebuild

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

FAILED: Continuous integration, rev:469
http://jenkins.qa.ubuntu.com/job/unity8-ci/1474/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/5133
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/3157/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2346
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/497
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1478
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1478/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1473
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1296
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/1008
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/1008/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3159
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3159/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2635/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2686/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/305
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/298

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1474/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

This looks good to me now. However, the same issue is still present in the Lockscreen. Should we fix that too? Actually the lockscreen shouldn't have a background but do heavy blurring of the stuff behind it. Not sure how long the blurring will still take. Maybe it's worth applying this fix there too in the meantime.

review: Needs Information
lp:~cimi/unity8/fix-1231731 updated
470. By Andrea Cimitan

Fix Lockscreen background and add test

471. By Andrea Cimitan

Delete tags

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

FAILED: Continuous integration, rev:470
http://jenkins.qa.ubuntu.com/job/unity8-ci/1496/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/104/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/98/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/20
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/20
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/20
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/20/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/20
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/98/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/104
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/104/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/98
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/98/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2725
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2776/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/496
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/478

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1496/rebuild

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

FAILED: Continuous integration, rev:471
http://jenkins.qa.ubuntu.com/job/unity8-ci/1499/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/114/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/108/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/23
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/23
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/23
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/23/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/23
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/108/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/114
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/114/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/108
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/108/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2734/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2785/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/508
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/506

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1499/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good to me now :-)

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

+1

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Greeter/Greeter.qml'
2--- Greeter/Greeter.qml 2013-09-13 15:17:02 +0000
3+++ Greeter/Greeter.qml 2013-10-25 13:49:16 +0000
4@@ -64,6 +64,7 @@
5 property var model: LightDM.Users
6 property int currentIndex: 0
7 property var infographicModel: LightDM.Infographic
8+ readonly property int backgroundTopMargin: -greeter.y
9
10 source: required ? "GreeterContent.qml" : ""
11
12
13=== modified file 'Greeter/GreeterContent.qml'
14--- Greeter/GreeterContent.qml 2013-10-03 04:28:13 +0000
15+++ Greeter/GreeterContent.qml 2013-10-25 13:49:16 +0000
16@@ -24,7 +24,7 @@
17 id: root
18 anchors.fill: parent
19
20- property bool ready: wallpaper.source == "" || wallpaper.status == Image.Ready || wallpaper.status == Image.Error
21+ property bool ready: background.source == "" || background.status == Image.Ready || background.status == Image.Error
22 property bool leftTeaserPressed: teasingMouseArea.pressed &&
23 teasingMouseArea.mouseX < teasingMouseArea.width / 2
24 property bool rightTeaserPressed: teasingMouseArea.pressed &&
25@@ -34,33 +34,36 @@
26 signal unlocked(int uid)
27
28 Rectangle {
29- // In case wallpaper fails to load
30- id: wallpaperBackup
31+ // In case background fails to load
32+ id: backgroundBackup
33 anchors.fill: parent
34 color: "black"
35 }
36
37 property url backgroundValue: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : greeter.defaultBackground
38- onBackgroundValueChanged: wallpaper.source = backgroundValue
39+ onBackgroundValueChanged: background.source = backgroundValue
40
41 CrossFadeImage {
42- id: wallpaper
43- objectName: "wallpaper"
44- anchors.fill: parent
45+ id: background
46+ objectName: "greeterBackground"
47+ anchors {
48+ fill: parent
49+ topMargin: backgroundTopMargin
50+ }
51 fillMode: Image.PreserveAspectCrop
52 }
53
54 // See Shell.qml's backgroundSettings treatment for why we need a separate
55 // Image, but it boils down to avoiding binding loop detection.
56 Image {
57- source: wallpaper.source
58+ source: background.source
59 height: 0
60 width: 0
61 sourceSize.height: 0
62 sourceSize.width: 0
63 onStatusChanged: {
64 if (status == Image.Error && source != greeter.defaultBackground) {
65- wallpaper.source = greeter.defaultBackground
66+ background.source = greeter.defaultBackground
67 }
68 }
69 }
70
71=== modified file 'Greeter/Lockscreen.qml'
72--- Greeter/Lockscreen.qml 2013-08-14 00:01:17 +0000
73+++ Greeter/Lockscreen.qml 2013-10-25 13:49:16 +0000
74@@ -54,15 +54,19 @@
75 }
76
77 Rectangle {
78- // In case wallpaper fails to load or is undefined
79- id: wallpaperBackup
80+ // In case background fails to load or is undefined
81+ id: backgroundBackup
82 anchors.fill: parent
83 color: "black"
84 }
85
86 Image {
87- id: wallpaper
88- anchors.fill: parent
89+ id: backgroundImage
90+ objectName: "lockscreenBackground"
91+ anchors {
92+ fill: parent
93+ topMargin: backgroundTopMargin
94+ }
95 source: root.required ? root.background : ""
96 fillMode: Image.PreserveAspectCrop
97 }
98
99=== modified file 'Shell.qml'
100--- Shell.qml 2013-10-16 15:52:38 +0000
101+++ Shell.qml 2013-10-25 13:49:16 +0000
102@@ -402,6 +402,10 @@
103
104 Lockscreen {
105 id: lockscreen
106+ objectName: "lockscreen"
107+
108+ readonly property int backgroundTopMargin: -panel.panelHeight
109+
110 hides: [launcher, panel.indicators, hud]
111 shown: false
112 enabled: true
113
114=== modified file 'tests/autopilot/unity8/shell/emulators/main_window.py'
115--- tests/autopilot/unity8/shell/emulators/main_window.py 2013-09-24 11:54:07 +0000
116+++ tests/autopilot/unity8/shell/emulators/main_window.py 2013-10-25 13:49:16 +0000
117@@ -43,6 +43,9 @@
118 objectName="greeterContentLoader"
119 )
120
121+ def get_greeter_background(self):
122+ return self.app.select_single("CrossFadeImage", objectName="greeterBackground")
123+
124 def get_login_loader(self):
125 return self.app.select_single("QQuickLoader", objectName="loginLoader")
126
127@@ -93,3 +96,6 @@
128
129 def get_pinentryField(self):
130 return self.app.select_single(objectName="pinentryField")
131+
132+ def get_shell_background(self):
133+ return self.app.select_single("CrossFadeImage", objectName="backgroundImage")
134
135=== added file 'tests/autopilot/unity8/shell/tests/test_greeter.py'
136--- tests/autopilot/unity8/shell/tests/test_greeter.py 1970-01-01 00:00:00 +0000
137+++ tests/autopilot/unity8/shell/tests/test_greeter.py 2013-10-25 13:49:16 +0000
138@@ -0,0 +1,38 @@
139+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
140+#
141+# Unity Autopilot Test Suite
142+# Copyright (C) 2012-2013 Canonical
143+#
144+# This program is free software: you can redistribute it and/or modify
145+# it under the terms of the GNU General Public License as published by
146+# the Free Software Foundation, either version 3 of the License, or
147+# (at your option) any later version.
148+#
149+# This program is distributed in the hope that it will be useful,
150+# but WITHOUT ANY WARRANTY; without even the implied warranty of
151+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
152+# GNU General Public License for more details.
153+#
154+# You should have received a copy of the GNU General Public License
155+# along with this program. If not, see <http://www.gnu.org/licenses/>.
156+#
157+
158+from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
159+
160+from testtools.matchers import Equals
161+
162+class TestGreeter(UnityTestCase):
163+
164+ """Tests the Shell Greeter."""
165+
166+ scenarios = _get_device_emulation_scenarios()
167+
168+ def test_greeter_background(self):
169+ """Test that the background of the greeter and the background of the shell are placed correctly
170+
171+ """
172+ self.launch_unity()
173+ self.main_window.get_greeter()
174+ greeter_background = self.main_window.get_greeter_background()
175+ shell_background = self.main_window.get_shell_background()
176+ self.assertThat(greeter_background.globalRect, Equals(shell_background.globalRect))
177
178=== modified file 'tests/qmltests/Greeter/tst_Phone.qml'
179--- tests/qmltests/Greeter/tst_Phone.qml 2013-09-30 16:03:59 +0000
180+++ tests/qmltests/Greeter/tst_Phone.qml 2013-10-25 13:49:16 +0000
181@@ -120,7 +120,7 @@
182 tryCompare(LightDM.Infographic, "username", "single")
183 }
184
185- function test_wallpaper_data() {
186+ function test_background_data() {
187 return [
188 {tag: "set", accounts: "../tests/data/unity/backgrounds/blue.png", expected: "blue.png"},
189 {tag: "unset", accounts: "", expected: "background.jpg"},
190@@ -128,12 +128,12 @@
191 ]
192 }
193
194- function test_wallpaper(data) {
195+ function test_background(data) {
196 var loader = findChild(greeter, "greeterContentLoader")
197- var wallpaper = findChild(loader.item, "wallpaper")
198+ var background = findChild(loader.item, "greeterBackground")
199 AccountsService.backgroundFile = data.accounts
200- tryCompareFunction(function() { return wallpaper.source.toString().indexOf(data.expected) !== -1; }, true)
201- tryCompare(wallpaper, "status", Image.Ready)
202+ tryCompareFunction(function() { return background.source.toString().indexOf(data.expected) !== -1; }, true)
203+ tryCompare(background, "status", Image.Ready)
204 }
205 }
206 }
207
208=== modified file 'tests/qmltests/tst_Shell.qml'
209--- tests/qmltests/tst_Shell.qml 2013-10-09 20:01:12 +0000
210+++ tests/qmltests/tst_Shell.qml 2013-10-25 13:49:16 +0000
211@@ -432,7 +432,7 @@
212 } while (!isStill);
213 }
214
215- function test_wallpaper_data() {
216+ function test_background_data() {
217 return [
218 {tag: "red", url: "tests/data/unity/backgrounds/red.png", expectedUrl: "tests/data/unity/backgrounds/red.png"},
219 {tag: "blue", url: "tests/data/unity/backgrounds/blue.png", expectedUrl: "tests/data/unity/backgrounds/blue.png"},
220@@ -441,13 +441,21 @@
221 ]
222 }
223
224- function test_wallpaper(data) {
225+ function test_background(data) {
226 var backgroundImage = findChild(shell, "backgroundImage")
227 GSettingsController.setPictureUri(data.url)
228 tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.expectedUrl) !== -1; }, true)
229 tryCompare(backgroundImage, "status", Image.Ready)
230 }
231
232+ function test_lockscreen_background() {
233+ var backgroundImage = findChild(shell, "backgroundImage")
234+ var lockscreen = findChild(shell, "lockscreen")
235+ var lockscreenBackground = findChild(lockscreen, "lockscreenBackground")
236+ var lockscreenBackgroundMapped = lockscreenBackground.mapToItem(shell, 0, 0)
237+ compare(backgroundImage.y, lockscreenBackgroundMapped.y)
238+ }
239+
240 function test_DashShown_data() {
241 return [
242 {tag: "in focus", greeter: false, app: false, launcher: false, indicators: false, expectedShown: true},

Subscribers

People subscribed via source and target branches