2
* Copyright 2014 Canonical Ltd.
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.
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.
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/>.
19
import Ubuntu.Test 0.1
20
import Ubuntu.Settings.Components 0.1
38
icon.sets = [ "status" ]
39
waitForRendering(icon)
42
function test_icon() {
43
icon.source = "image://theme/bar,gps,baz";
45
var image = findChild(icon, "image");
46
tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("gps"));
49
function test_iconFallback() {
50
icon.source = "image://theme/foo,bar,baz";
52
var image = findChild(icon, "image");
53
tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("baz"));
56
function test_iconSets() {
57
icon.source = "image://theme/bar,add,baz";
58
icon.sets = [ "foo", "actions", "bar" ]
60
var image = findChild(icon, "image");
61
tryCompare(image, "source", "file://" + image.iconPath.arg("actions").arg("add"));
64
function test_iconSetsFallback() {
65
icon.source = "image://theme/add,bar,baz";
66
icon.sets = [ "foo", "bar", "baz" ]
68
var image = findChild(icon, "image");
69
tryCompare(image, "source", "file://" + image.iconPath.arg("baz").arg("baz"));
72
function test_iconSource() {
73
var image = findChild(icon, "image");
74
icon.source = image.iconPath.arg("status").arg("gps");
76
tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("gps"));