aboutsummaryrefslogtreecommitdiff
path: root/tests/integration/indicator-sound-test-base.cpp
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-26 12:01:16 +0100
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-26 12:01:16 +0100
commit698baf72cd6a606d9c8101c31e0d40b38d48a8bb (patch)
tree93c3ffbc9bb122892981cd79e7ee875cb2a2e883 /tests/integration/indicator-sound-test-base.cpp
parentdc719904611197a1f01fc4034f4678ffae556491 (diff)
downloadayatana-indicator-sound-698baf72cd6a606d9c8101c31e0d40b38d48a8bb.tar.gz
ayatana-indicator-sound-698baf72cd6a606d9c8101c31e0d40b38d48a8bb.tar.bz2
ayatana-indicator-sound-698baf72cd6a606d9c8101c31e0d40b38d48a8bb.zip
Changed unit test to wait for the indicator to connect the user accounts
Diffstat (limited to 'tests/integration/indicator-sound-test-base.cpp')
-rw-r--r--tests/integration/indicator-sound-test-base.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index 2bd71b6..dd5d4b5 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -407,11 +407,11 @@ void IndicatorSoundTestBase::initializeAccountsInterface()
auto username = qgetenv("USER");
if (username != "")
{
- std::unique_ptr<AccountsInterface> accountsInterface(new AccountsInterface("org.freedesktop.Accounts",
+ main_accounts_interface_.reset(new AccountsInterface("org.freedesktop.Accounts",
"/org/freedesktop/Accounts",
dbusTestRunner.systemConnection(), 0));
- QDBusReply<QDBusObjectPath> userResp = accountsInterface->call(QLatin1String("FindUserByName"),
+ QDBusReply<QDBusObjectPath> userResp = main_accounts_interface_->call(QLatin1String("FindUserByName"),
QLatin1String(username));
if (!userResp.isValid())
@@ -805,3 +805,16 @@ void IndicatorSoundTestBase::checkPortDevicesLabels(DevicePortType speakerPort,
)
).match());
}
+
+bool IndicatorSoundTestBase::setVolumeUntilAccountsIsConnected(double volume)
+{
+ int RETRY_TIME = 5000;
+
+ setActionValue("volume", QVariant::fromValue(volume));
+ while(!signal_spy_volume_changed_->wait(10) && RETRY_TIME)
+ {
+ RETRY_TIME -= 10;
+ setActionValue("volume", QVariant::fromValue(volume));
+ }
+ return (signal_spy_volume_changed_->count() != 0);
+}