~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-yakkety-landing-001

« back to all changes in this revision

Viewing changes to tests/qmltests/Components/tst_StatusIcon.qml

  • Committer: Bileto Bot
  • Author(s): Albert Astals Cid
  • Date: 2016-08-09 23:00:16 UTC
  • mfrom: (155.2.1 ubuntu-settings-components)
  • Revision ID: ci-train-bot@canonical.com-20160809230016-cwgog0n28bbri9ux
Remove StatusIcon, we've moved to SDK Icon

Approved by: Andrea Cimitan, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2014 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.4
18
 
import QtTest 1.0
19
 
import Ubuntu.Test 0.1
20
 
import Ubuntu.Settings.Components 0.1
21
 
 
22
 
Item {
23
 
    width: units.gu(40)
24
 
    height: units.gu(70)
25
 
 
26
 
    StatusIcon {
27
 
        id: icon
28
 
 
29
 
        height: units.gu(3)
30
 
    }
31
 
 
32
 
    UbuntuTestCase {
33
 
        name: "StatusIcon"
34
 
        when: windowShown
35
 
 
36
 
        function init() {
37
 
            icon.source = "";
38
 
            icon.sets = [ "status" ]
39
 
            waitForRendering(icon)
40
 
        }
41
 
 
42
 
        function test_icon() {
43
 
            icon.source = "image://theme/bar,gps,baz";
44
 
 
45
 
            var image = findChild(icon, "image");
46
 
            tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("gps"));
47
 
        }
48
 
 
49
 
        function test_iconFallback() {
50
 
            icon.source = "image://theme/foo,bar,baz";
51
 
 
52
 
            var image = findChild(icon, "image");
53
 
            tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("baz"));
54
 
        }
55
 
 
56
 
        function test_iconSets() {
57
 
            icon.source = "image://theme/bar,add,baz";
58
 
            icon.sets = [ "foo", "actions", "bar" ]
59
 
 
60
 
            var image = findChild(icon, "image");
61
 
            tryCompare(image, "source", "file://" + image.iconPath.arg("actions").arg("add"));
62
 
        }
63
 
 
64
 
        function test_iconSetsFallback() {
65
 
            icon.source = "image://theme/add,bar,baz";
66
 
            icon.sets = [ "foo", "bar", "baz" ]
67
 
 
68
 
            var image = findChild(icon, "image");
69
 
            tryCompare(image, "source", "file://" + image.iconPath.arg("baz").arg("baz"));
70
 
        }
71
 
 
72
 
        function test_iconSource() {
73
 
            var image = findChild(icon, "image");
74
 
            icon.source = image.iconPath.arg("status").arg("gps");
75
 
 
76
 
            tryCompare(image, "source", "file://" + image.iconPath.arg("status").arg("gps"));
77
 
        }
78
 
    }
79
 
}