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

Unified Diff: talk/app/webrtc/peerconnection_unittest.cc

Issue 1473013002: Fixing direction attribute in answer for non-RTP protocols. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | talk/session/media/mediasession.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/peerconnection_unittest.cc
diff --git a/talk/app/webrtc/peerconnection_unittest.cc b/talk/app/webrtc/peerconnection_unittest.cc
index 6307bfc6d88d45819d8ad731d2e1b76a0aeb5625..6dc83a575132d889462568b9f5abd6b8b6e4fab8 100644
--- a/talk/app/webrtc/peerconnection_unittest.cc
+++ b/talk/app/webrtc/peerconnection_unittest.cc
@@ -1450,8 +1450,9 @@ TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, GetDtls12Recv) {
kDefaultSrtpCryptoSuite));
}
-// This test sets up a call between two parties with audio, video and data.
-TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestDataChannel) {
+// This test sets up a call between two parties with audio, video and an RTP
+// data channel.
+TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestRtpDataChannel) {
FakeConstraints setup_constraints;
setup_constraints.SetAllowRtpDataChannels();
ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints));
@@ -1481,6 +1482,35 @@ TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestDataChannel) {
EXPECT_FALSE(receiving_client()->data_observer()->IsOpen());
}
+// This test sets up a call between two parties with audio, video and an SCTP
+// data channel.
+TEST_F(MAYBE_JsepPeerConnectionP2PTestClient, LocalP2PTestSctpDataChannel) {
+ ASSERT_TRUE(CreateTestClients());
+ initializing_client()->CreateDataChannel();
+ LocalP2PTest();
+ ASSERT_TRUE(initializing_client()->data_channel() != nullptr);
+ EXPECT_TRUE_WAIT(receiving_client()->data_channel() != nullptr, kMaxWaitMs);
+ EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(),
+ kMaxWaitMs);
+ EXPECT_TRUE_WAIT(receiving_client()->data_observer()->IsOpen(), kMaxWaitMs);
+
+ std::string data = "hello world";
+
+ initializing_client()->data_channel()->Send(DataBuffer(data));
+ EXPECT_EQ_WAIT(data, receiving_client()->data_observer()->last_message(),
+ kMaxWaitMs);
+
+ receiving_client()->data_channel()->Send(DataBuffer(data));
+ EXPECT_EQ_WAIT(data, initializing_client()->data_observer()->last_message(),
+ kMaxWaitMs);
+
+ receiving_client()->data_channel()->Close();
+ // Send new offer and answer.
+ receiving_client()->Negotiate();
+ EXPECT_FALSE(initializing_client()->data_observer()->IsOpen());
+ EXPECT_FALSE(receiving_client()->data_observer()->IsOpen());
+}
+
// This test sets up a call between two parties and creates a data channel.
// The test tests that received data is buffered unless an observer has been
// registered.
« no previous file with comments | « no previous file | talk/session/media/mediasession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698