on xenial help sign in
Add a C++ test for switching profiles
commit84782dfdd2faad0b5687c39a109ce2da34356aeb authorMichael Terry <michael.terry@canonical.com> dateTue 10 Feb 2015, 11:05 (12 years ago) parent07d4cc3
1 file changed+20
tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp+20
tests/plugins/Unity/Indicators/indicatorsmanagertest.cpp+20
@@ -110,6 +110,26 @@ private Q_SLOTS:
110110 QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test2"));
111111 }
112112
113+ /*
114+ * Test switching the indicator profile data
115+ */
116+ void testPluginInterfaceProfileSwitch()
117+ {
118+ IndicatorsManager manager;
119+ manager.setProfile("test1");
120+ manager.load();
121+
122+ Indicator::Ptr indicator = manager.indicator("indicator-fake1");
123+ QVERIFY(indicator ? true : false);
124+
125+ QVariantMap props = indicator->indicatorProperties().toMap();
126+ QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test1"));
127+
128+ manager.setProfile("test2");
129+ props = indicator->indicatorProperties().toMap();
130+ QCOMPARE(props["menuObjectPath"].toString(), QString("/com/canonical/indicator/fake1/test2"));
131+ }
132+
113133 /*
114134 * Test if a new plugin object is create for each different plugin
115135 */