@@ -18,8 +18,8 @@ import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
2020import "../../../Greeter"
21+import AccountsService 0.1
2122import Ubuntu.Components 0.1
22−import LightDM 0.1 as LightDM
2323import Unity.Test 0.1 as UT
2424
2525Item {
@@ -32,6 +32,8 @@ Item {
3232 height: parent.height
3333 x: 0; y: 0
3434
35+ defaultBackground: "../../../graphics/phone_background.jpg"
36+
3537 property int minX: 0
3638
3739 onXChanged: {
@@ -102,5 +104,21 @@ Item {
102104 // Wait until we're back to 0
103105 tryCompareFunction(function() { return greeter.x;}, 0);
104106 }
107+
108+ function test_wallpaper_data() {
109+ return [
110+ {tag: "set", accounts: "../tests/data/unity/backgrounds/blue.png", expected: "blue.png"},
111+ {tag: "unset", accounts: "", expected: "background.jpg"},
112+ {tag: "invalid", accounts: "invalid", expected: "background.jpg"},
113+ ]
114+ }
115+
116+ function test_wallpaper(data) {
117+ var loader = findChild(greeter, "greeterContentLoader")
118+ var wallpaper = findChild(loader.item, "wallpaper")
119+ AccountsService.backgroundFile = data.accounts
120+ tryCompareFunction(function() { return wallpaper.source.toString().indexOf(data.expected) !== -1; }, true)
121+ tryCompare(wallpaper, "status", Image.Ready)
122+ }
105123 }
106124}