~nick-dedekind/unity8/indicators.hint-interval

« back to all changes in this revision

Viewing changes to tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp

  • Committer: Nick Dedekind
  • Date: 2014-03-07 15:54:57 UTC
  • mfrom: (638.1.118 unity8)
  • Revision ID: nicholas.dedekind@gmail.com-20140307155457-f0s1zu5ll2czt3rq
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        QVERIFY(!manager.isLoaded());
51
51
        QCOMPARE(manager.indicators().count(), 0);
52
52
 
53
 
        manager.load();
 
53
        manager.load("test1");
54
54
 
55
55
        QVERIFY(manager.isLoaded());
56
56
        QCOMPARE(manager.indicators().count(), 4);
64
64
    /*
65
65
     * Test the creation & initialising of the indicator data
66
66
     */
67
 
    void testPluginInterface()
68
 
    {
69
 
        IndicatorsManager manager;
70
 
        manager.load();
71
 
 
72
 
        Indicator::Ptr indicator = manager.indicator("indicator-fake1");
73
 
        QVERIFY(indicator ? true : false);
74
 
 
75
 
        QCOMPARE(indicator->identifier(), QString("indicator-fake1"));
76
 
        QCOMPARE(indicator->position(), 1);
77
 
 
78
 
        // Check that the initial properties have been set.
79
 
        QVariantMap props = indicator->indicatorProperties().toMap();
80
 
        QCOMPARE(props.count(), 4);
81
 
        QCOMPARE(props["busName"].toString(), QString("com.canonical.indicator.fake1"));
82
 
        QCOMPARE(props["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
83
 
 
84
 
        QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/phone"));
 
67
    void testPluginInterfaceProfile1()
 
68
    {
 
69
        IndicatorsManager manager;
 
70
        manager.load("test1");
 
71
 
 
72
        Indicator::Ptr indicator = manager.indicator("indicator-fake1");
 
73
        QVERIFY(indicator ? true : false);
 
74
 
 
75
        QCOMPARE(indicator->identifier(), QString("indicator-fake1"));
 
76
        QCOMPARE(indicator->position(), 1);
 
77
 
 
78
        // Check that the initial properties have been set.
 
79
        QVariantMap props = indicator->indicatorProperties().toMap();
 
80
        QCOMPARE(props.count(), 4);
 
81
        QCOMPARE(props["busName"].toString(), QString("com.canonical.indicator.fake1"));
 
82
        QCOMPARE(props["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
 
83
 
 
84
        QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test1"));
 
85
    }
 
86
 
 
87
    /*
 
88
     * Test the creation & initialising of the indicator data
 
89
     */
 
90
    void testPluginInterfaceProfile2()
 
91
    {
 
92
        IndicatorsManager manager;
 
93
        manager.load("test2");
 
94
 
 
95
        Indicator::Ptr indicator = manager.indicator("indicator-fake1");
 
96
        QVERIFY(indicator ? true : false);
 
97
 
 
98
        QCOMPARE(indicator->identifier(), QString("indicator-fake1"));
 
99
        QCOMPARE(indicator->position(), 1);
 
100
 
 
101
        // Check that the initial properties have been set.
 
102
        QVariantMap props = indicator->indicatorProperties().toMap();
 
103
        QCOMPARE(props.count(), 4);
 
104
        QCOMPARE(props["busName"].toString(), QString("com.canonical.indicator.fake1"));
 
105
        QCOMPARE(props["actionsObjectPath"].toString(), QString("/com/canonical/indicator/fake1"));
 
106
 
 
107
        QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test2"));
85
108
    }
86
109
 
87
110
    /*
90
113
    void testPluginInstance()
91
114
    {
92
115
        IndicatorsManager manager;
93
 
        manager.load();
 
116
        manager.load("test2");
94
117
 
95
118
        Indicator::Ptr i0 = manager.indicator("indicator-fake1");
96
119
        Indicator::Ptr i1 = manager.indicator("indicator-fake1");
110
133
    void testPluginInitAndShutdown()
111
134
    {
112
135
        IndicatorsManager manager;
113
 
        manager.load();
 
136
        manager.load("test1");
114
137
 
115
138
        QWeakPointer<Indicator> wp0;
116
139
        QWeakPointer<Indicator> wp1;