| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 // Test that GCM isn't used if only the initiator supports it. | 2039 // Test that GCM isn't used if only the initiator supports it. |
| 2040 TEST_F(P2PTestConductor, GetGcmInit) { | 2040 TEST_F(P2PTestConductor, GetGcmInit) { |
| 2041 TestGcmNegotiation(true, false, kDefaultSrtpCryptoSuite); | 2041 TestGcmNegotiation(true, false, kDefaultSrtpCryptoSuite); |
| 2042 } | 2042 } |
| 2043 | 2043 |
| 2044 // Test that GCM isn't used if only the receiver supports it. | 2044 // Test that GCM isn't used if only the receiver supports it. |
| 2045 TEST_F(P2PTestConductor, GetGcmRecv) { | 2045 TEST_F(P2PTestConductor, GetGcmRecv) { |
| 2046 TestGcmNegotiation(false, true, kDefaultSrtpCryptoSuite); | 2046 TestGcmNegotiation(false, true, kDefaultSrtpCryptoSuite); |
| 2047 } | 2047 } |
| 2048 | 2048 |
| 2049 // Disabled due to flakiness, see http://crbug.com/webrtc/6776 | |
| 2050 #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) | |
| 2051 #define MAYBE_LocalP2PTestRtpDataChannel DISABLED_LocalP2PTestRtpDataChannel | |
| 2052 #else | |
| 2053 #define MAYBE_LocalP2PTestRtpDataChannel LocalP2PTestRtpDataChannel | |
| 2054 #endif | |
| 2055 // This test sets up a call between two parties with audio, video and an RTP | 2049 // This test sets up a call between two parties with audio, video and an RTP |
| 2056 // data channel. | 2050 // data channel. |
| 2057 TEST_F(P2PTestConductor, MAYBE_LocalP2PTestRtpDataChannel) { | 2051 TEST_F(P2PTestConductor, LocalP2PTestRtpDataChannel) { |
| 2058 FakeConstraints setup_constraints; | 2052 FakeConstraints setup_constraints; |
| 2059 setup_constraints.SetAllowRtpDataChannels(); | 2053 setup_constraints.SetAllowRtpDataChannels(); |
| 2060 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 2054 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
| 2061 initializing_client()->CreateDataChannel(); | 2055 initializing_client()->CreateDataChannel(); |
| 2062 LocalP2PTest(); | 2056 LocalP2PTest(); |
| 2063 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); | 2057 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); |
| 2064 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); | 2058 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); |
| 2065 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), | 2059 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), |
| 2066 kMaxWaitMs); | 2060 kMaxWaitMs); |
| 2067 EXPECT_TRUE_WAIT(receiving_client()->data_observer()->IsOpen(), | 2061 EXPECT_TRUE_WAIT(receiving_client()->data_observer()->IsOpen(), |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2200 SendRtpData(initializing_client()->data_channel(), data); | 2194 SendRtpData(initializing_client()->data_channel(), data); |
| 2201 | 2195 |
| 2202 // Wait a while to allow the sent data to arrive before an observer is | 2196 // Wait a while to allow the sent data to arrive before an observer is |
| 2203 // registered.. | 2197 // registered.. |
| 2204 rtc::Thread::Current()->ProcessMessages(100); | 2198 rtc::Thread::Current()->ProcessMessages(100); |
| 2205 | 2199 |
| 2206 MockDataChannelObserver new_observer(receiving_client()->data_channel()); | 2200 MockDataChannelObserver new_observer(receiving_client()->data_channel()); |
| 2207 EXPECT_EQ_WAIT(data, new_observer.last_message(), kMaxWaitMs); | 2201 EXPECT_EQ_WAIT(data, new_observer.last_message(), kMaxWaitMs); |
| 2208 } | 2202 } |
| 2209 | 2203 |
| 2210 // Disabled due to flakiness, see http://crbug.com/webrtc/6776 | |
| 2211 #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) | |
| 2212 #define MAYBE_LocalP2PTestReceiverDoesntSupportData DISABLED_LocalP2PTestReceive
rDoesntSupportData | |
| 2213 #else | |
| 2214 #define MAYBE_LocalP2PTestReceiverDoesntSupportData LocalP2PTestReceiverDoesntSu
pportData | |
| 2215 #endif | |
| 2216 // This test sets up a call between two parties with audio, video and but only | 2204 // This test sets up a call between two parties with audio, video and but only |
| 2217 // the initiating client support data. | 2205 // the initiating client support data. |
| 2218 TEST_F(P2PTestConductor, MAYBE_LocalP2PTestReceiverDoesntSupportData) { | 2206 TEST_F(P2PTestConductor, LocalP2PTestReceiverDoesntSupportData) { |
| 2219 FakeConstraints setup_constraints_1; | 2207 FakeConstraints setup_constraints_1; |
| 2220 setup_constraints_1.SetAllowRtpDataChannels(); | 2208 setup_constraints_1.SetAllowRtpDataChannels(); |
| 2221 // Must disable DTLS to make negotiation succeed. | 2209 // Must disable DTLS to make negotiation succeed. |
| 2222 setup_constraints_1.SetMandatory( | 2210 setup_constraints_1.SetMandatory( |
| 2223 MediaConstraintsInterface::kEnableDtlsSrtp, false); | 2211 MediaConstraintsInterface::kEnableDtlsSrtp, false); |
| 2224 FakeConstraints setup_constraints_2; | 2212 FakeConstraints setup_constraints_2; |
| 2225 setup_constraints_2.SetMandatory( | 2213 setup_constraints_2.SetMandatory( |
| 2226 MediaConstraintsInterface::kEnableDtlsSrtp, false); | 2214 MediaConstraintsInterface::kEnableDtlsSrtp, false); |
| 2227 ASSERT_TRUE(CreateTestClients(&setup_constraints_1, &setup_constraints_2)); | 2215 ASSERT_TRUE(CreateTestClients(&setup_constraints_1, &setup_constraints_2)); |
| 2228 initializing_client()->CreateDataChannel(); | 2216 initializing_client()->CreateDataChannel(); |
| 2229 LocalP2PTest(); | 2217 LocalP2PTest(); |
| 2230 EXPECT_TRUE(initializing_client()->data_channel() != nullptr); | 2218 EXPECT_TRUE(initializing_client()->data_channel() != nullptr); |
| 2231 EXPECT_FALSE(receiving_client()->data_channel()); | 2219 EXPECT_FALSE(receiving_client()->data_channel()); |
| 2232 EXPECT_FALSE(initializing_client()->data_observer()->IsOpen()); | 2220 EXPECT_FALSE(initializing_client()->data_observer()->IsOpen()); |
| 2233 } | 2221 } |
| 2234 | 2222 |
| 2235 // Disabled due to flakiness, see http://crbug.com/webrtc/6776 | |
| 2236 #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) | |
| 2237 #define MAYBE_AddDataChannelAfterRenegotiation DISABLED_AddDataChannelAfterReneg
otiation | |
| 2238 #else | |
| 2239 #define MAYBE_AddDataChannelAfterRenegotiation AddDataChannelAfterRenegotiation | |
| 2240 #endif | |
| 2241 // This test sets up a call between two parties with audio, video. When audio | 2223 // This test sets up a call between two parties with audio, video. When audio |
| 2242 // and video is setup and flowing and data channel is negotiated. | 2224 // and video is setup and flowing and data channel is negotiated. |
| 2243 TEST_F(P2PTestConductor, MAYBE_AddDataChannelAfterRenegotiation) { | 2225 TEST_F(P2PTestConductor, AddDataChannelAfterRenegotiation) { |
| 2244 FakeConstraints setup_constraints; | 2226 FakeConstraints setup_constraints; |
| 2245 setup_constraints.SetAllowRtpDataChannels(); | 2227 setup_constraints.SetAllowRtpDataChannels(); |
| 2246 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 2228 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); |
| 2247 LocalP2PTest(); | 2229 LocalP2PTest(); |
| 2248 initializing_client()->CreateDataChannel(); | 2230 initializing_client()->CreateDataChannel(); |
| 2249 // Send new offer and answer. | 2231 // Send new offer and answer. |
| 2250 initializing_client()->Negotiate(); | 2232 initializing_client()->Negotiate(); |
| 2251 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); | 2233 ASSERT_TRUE(initializing_client()->data_channel() != nullptr); |
| 2252 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); | 2234 ASSERT_TRUE(receiving_client()->data_channel() != nullptr); |
| 2253 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), | 2235 EXPECT_TRUE_WAIT(initializing_client()->data_observer()->IsOpen(), |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2802 server.urls.push_back("turn:hostname2"); | 2784 server.urls.push_back("turn:hostname2"); |
| 2803 servers.push_back(server); | 2785 servers.push_back(server); |
| 2804 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); | 2786 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); |
| 2805 EXPECT_EQ(2U, turn_servers_.size()); | 2787 EXPECT_EQ(2U, turn_servers_.size()); |
| 2806 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); | 2788 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); |
| 2807 } | 2789 } |
| 2808 | 2790 |
| 2809 #endif // if !defined(THREAD_SANITIZER) | 2791 #endif // if !defined(THREAD_SANITIZER) |
| 2810 | 2792 |
| 2811 } // namespace | 2793 } // namespace |
| OLD | NEW |