summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2011-09-28 18:52:23 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2011-09-30 10:48:49 -0300
commit8e14c13ce7534ba64693444a0f4fc7723894fdf1 (patch)
treea3da42fcb61abd59ca4244dc227e7f78c1a4454b
parent773ae84812eb90825b520dab3bd807c9f98ea30b (diff)
client-factories test: Add more specific tests for ChannelFactory::featuresFor*.
-rw-r--r--qt4/tests/dbus/client-factories.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/qt4/tests/dbus/client-factories.cpp b/qt4/tests/dbus/client-factories.cpp
index 0a47d560a..ef5aa445e 100644
--- a/qt4/tests/dbus/client-factories.cpp
+++ b/qt4/tests/dbus/client-factories.cpp
@@ -1117,6 +1117,57 @@ void TestClientFactories::testChannelFactoryAccessors()
QCOMPARE(chanFact->featuresFor(ChannelClassSpec::contactSearch()), contactSearchFeatures);
QCOMPARE(chanFact->featuresForContactSearches(), contactSearchFeatures);
+
+ Features streamedMediaAudioFeatures;
+ streamedMediaAudioFeatures.insert(StreamedMediaChannel::FeatureStreams);
+ chanFact->addFeaturesFor(ChannelClassSpec::streamedMediaAudioCall(),
+ streamedMediaAudioFeatures);
+ streamedMediaAudioFeatures |= streamedMediaFeatures;
+
+ QCOMPARE(chanFact->featuresForStreamedMediaCalls(), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaAudioCall()), streamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaVideoCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaVideoCallWithAudio()), streamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaAudioCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaVideoCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaVideoCallWithAudio()), streamedMediaFeatures);
+
+ Features unnamedStreamedMediaAudioFeatures;
+ unnamedStreamedMediaAudioFeatures.insert(StreamedMediaChannel::FeatureLocalHoldState);
+ chanFact->addFeaturesFor(ChannelClassSpec::unnamedStreamedMediaAudioCall(),
+ unnamedStreamedMediaAudioFeatures);
+ unnamedStreamedMediaAudioFeatures |= streamedMediaFeatures;
+
+ QCOMPARE(chanFact->featuresForStreamedMediaCalls(), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaAudioCall()), streamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaVideoCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaVideoCallWithAudio()), streamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaAudioCall()), unnamedStreamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaVideoCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaVideoCallWithAudio()), unnamedStreamedMediaAudioFeatures);
+
+ QVariantMap otherProps;
+ otherProps.insert(QLatin1String("ping"), QLatin1String("pong"));
+ Features specificUnnamedStreamedMediaFeatures;
+ specificUnnamedStreamedMediaFeatures.insert(Feature(QLatin1String("TestClass"), 1234));
+ chanFact->addFeaturesFor(ChannelClassSpec::unnamedStreamedMediaCall(otherProps),
+ specificUnnamedStreamedMediaFeatures);
+ specificUnnamedStreamedMediaFeatures |= streamedMediaFeatures;
+
+ QCOMPARE(chanFact->featuresForStreamedMediaCalls(), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaAudioCall()), streamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaVideoCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::streamedMediaVideoCallWithAudio()), streamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaCall(otherProps)), specificUnnamedStreamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaAudioCall()), unnamedStreamedMediaAudioFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaVideoCall()), streamedMediaFeatures);
+ QCOMPARE(chanFact->featuresFor(ChannelClassSpec::unnamedStreamedMediaVideoCallWithAudio()), unnamedStreamedMediaAudioFeatures);
}
void TestClientFactories::cleanup()