Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1578)

Unified Diff: remoting/protocol/content_description_unittest.cc

Issue 10834446: Improve handling of NONE transport in channel configuration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/content_description.cc ('k') | remoting/protocol/session_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/content_description_unittest.cc
diff --git a/remoting/protocol/content_description_unittest.cc b/remoting/protocol/content_description_unittest.cc
index a3ef1d577b53cab2c0bfe54b2d13fa5c559aaf59..25aa8b6eda0fa7f5a71d6c56cfc1da69d850883c 100644
--- a/remoting/protocol/content_description_unittest.cc
+++ b/remoting/protocol/content_description_unittest.cc
@@ -37,7 +37,7 @@ TEST(ContentDescriptionTest, FormatAndParse) {
// Verify that we can still parse configs with transports that we don't
// recognize.
-TEST(ContentDescription, ParseUnknown) {
+TEST(ContentDescriptionTest, ParseUnknown) {
std::string kTestDescription =
"<description xmlns=\"google:remoting\">"
" <control transport=\"stream\" version=\"2\"/>"
@@ -57,6 +57,46 @@ TEST(ContentDescription, ParseUnknown) {
ChannelConfig::CODEC_UNDEFINED));
}
+// Verify that we can parse configs with none transport without version and
+// codec.
+TEST(ContentDescriptionTest, NoneTransport) {
+ std::string kTestDescription =
+ "<description xmlns=\"google:remoting\">"
+ " <control transport=\"stream\" version=\"2\"/>"
+ " <event transport=\"stream\" version=\"2\"/>"
+ " <event transport=\"stream\" version=\"2\"/>"
+ " <video transport=\"stream\" version=\"2\" codec=\"vp8\"/>"
+ " <audio transport=\"none\"/>"
+ " <authentication/>"
+ "</description>";
+ scoped_ptr<buzz::XmlElement> xml(buzz::XmlElement::ForStr(kTestDescription));
+ scoped_ptr<ContentDescription> parsed(
+ ContentDescription::ParseXml(xml.get()));
+ ASSERT_TRUE(parsed.get());
+ EXPECT_EQ(1U, parsed->config()->audio_configs().size());
+ EXPECT_TRUE(parsed->config()->audio_configs()[0] == ChannelConfig());
+}
+
+// Verify that we can parse configs with none transport with version and
+// codec.
+TEST(ContentDescriptionTest, NoneTransportWithCodec) {
+ std::string kTestDescription =
+ "<description xmlns=\"google:remoting\">"
+ " <control transport=\"stream\" version=\"2\"/>"
+ " <event transport=\"stream\" version=\"2\"/>"
+ " <event transport=\"stream\" version=\"2\"/>"
+ " <video transport=\"stream\" version=\"2\" codec=\"vp8\"/>"
+ " <audio transport=\"none\" version=\"2\" codec=\"verbatim\"/>"
+ " <authentication/>"
+ "</description>";
+ scoped_ptr<buzz::XmlElement> xml(buzz::XmlElement::ForStr(kTestDescription));
+ scoped_ptr<ContentDescription> parsed(
+ ContentDescription::ParseXml(xml.get()));
+ ASSERT_TRUE(parsed.get());
+ EXPECT_EQ(1U, parsed->config()->audio_configs().size());
+ EXPECT_TRUE(parsed->config()->audio_configs()[0] == ChannelConfig());
+}
+
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/content_description.cc ('k') | remoting/protocol/session_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698