on xenial help sign in
Added unit-test for new DBus-API Alert() of launcher-model.
commite35449387026e579cd90e9c8c6735225ca09021d authorMirco Müller <mirco.mueller@ubuntu.com> dateThu 16 Jul 2015, 18:04 (11 years ago) parent5a5162c
1 file changed+14
tests/plugins/Unity/Launcher/launchermodeltest.cpp+14
tests/plugins/Unity/Launcher/launchermodeltest.cpp+14
@@ -461,6 +461,20 @@ private Q_SLOTS:
461461 QCOMPARE(index == -1, !isRunning && !isPinned && !startWhenVisible);
462462 }
463463
464+ void testAlert() {
465+ // Check that the alerting-status is still false
466+ int index = launcherModel->findApplication("abs-icon");
467+ QCOMPARE(index >= 0, true);
468+ QVERIFY(launcherModel->get(index)->alerting() == false);
469+
470+ // Call Alert() on "abs-icon"
471+ QDBusInterface interface("com.canonical.Unity.Launcher", "/com/canonical/Unity/Launcher/abs_2Dicon", "com.canonical.Unity.Launcher.Item");
472+ interface.call("Alert");
473+
474+ // Check that the alerting-status is now true
475+ QVERIFY(launcherModel->get(index)->alerting() == true);
476+ }
477+
464478 void testRefreshAfterDeletedDesktopFiles_data() {
465479 QTest::addColumn<bool>("deleted");
466480 QTest::newRow("have .desktop files") << false;