@@ -0,0 +1,78 @@
2+ * Copyright (C) 2013 Canonical, Ltd.
5+ * Michael Terry <michael.terry@canonical.com>
7+ * This program is free software; you can redistribute it and/or modify
8+ * it under the terms of the GNU General Public License as published by
9+ * the Free Software Foundation; version 3.
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
22+import AccountsService 0.1
24+import Unity.Application 0.1
25+import Unity.Test 0.1 as UT
35+ id: applicationArguments
37+ function hasGeometry() {
58+ function test_wallpaper_data() {
60+ {tag: "both", accounts: "tests/data/unity/backgrounds/blue.png", gsettings: "tests/data/unity/backgrounds/red.png", expected: "blue.png"},
61+ {tag: "accounts", accounts: "tests/data/unity/backgrounds/blue.png", gsettings: "", expected: "blue.png"},
62+ {tag: "gsettings", accounts: "", gsettings: "tests/data/unity/backgrounds/red.png", expected: "red.png"},
63+ {tag: "none", accounts: "", gsettings: "", expected: shell.defaultBackground},
64+ {tag: "invalid-both", accounts: "invalid", gsettings: "invalid", expected: shell.defaultBackground},
65+ {tag: "invalid-accounts", accounts: "invalid", gsettings: "tests/data/unity/backgrounds/red.png", expected: shell.defaultBackground},
66+ {tag: "invalid-gsettings", accounts: "tests/data/unity/backgrounds/blue.png", gsettings: "invalid", expected: "blue.png"},
70+ function test_wallpaper(data) {
71+ var backgroundImage = findChild(shell, "backgroundImage")
72+ GSettingsController.setPictureUri(data.gsettings)
73+ AccountsService.backgroundFile = data.accounts
74+ tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.expected) !== -1; }, true)
75+ tryCompare(backgroundImage, "status", Image.Ready)