| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 | 1578 |
| 1579 initializing_client()->data_channel()->Send(DataBuffer(data)); | 1579 initializing_client()->data_channel()->Send(DataBuffer(data)); |
| 1580 EXPECT_EQ_WAIT(data, receiving_client()->data_observer()->last_message(), | 1580 EXPECT_EQ_WAIT(data, receiving_client()->data_observer()->last_message(), |
| 1581 kMaxWaitMs); | 1581 kMaxWaitMs); |
| 1582 | 1582 |
| 1583 receiving_client()->data_channel()->Send(DataBuffer(data)); | 1583 receiving_client()->data_channel()->Send(DataBuffer(data)); |
| 1584 EXPECT_EQ_WAIT(data, initializing_client()->data_observer()->last_message(), | 1584 EXPECT_EQ_WAIT(data, initializing_client()->data_observer()->last_message(), |
| 1585 kMaxWaitMs); | 1585 kMaxWaitMs); |
| 1586 | 1586 |
| 1587 receiving_client()->data_channel()->Close(); | 1587 receiving_client()->data_channel()->Close(); |
| 1588 // Send new offer and answer. | 1588 EXPECT_TRUE_WAIT(!initializing_client()->data_observer()->IsOpen(), |
| 1589 receiving_client()->Negotiate(); | 1589 kMaxWaitMs); |
| 1590 EXPECT_FALSE(initializing_client()->data_observer()->IsOpen()); | 1590 EXPECT_TRUE_WAIT(!receiving_client()->data_observer()->IsOpen(), kMaxWaitMs); |
| 1591 EXPECT_FALSE(receiving_client()->data_observer()->IsOpen()); | |
| 1592 } | 1591 } |
| 1593 | 1592 |
| 1594 // This test sets up a call between two parties and creates a data channel. | 1593 // This test sets up a call between two parties and creates a data channel. |
| 1595 // The test tests that received data is buffered unless an observer has been | 1594 // The test tests that received data is buffered unless an observer has been |
| 1596 // registered. | 1595 // registered. |
| 1597 // Rtp data channels can receive data before the underlying | 1596 // Rtp data channels can receive data before the underlying |
| 1598 // transport has detected that a channel is writable and thus data can be | 1597 // transport has detected that a channel is writable and thus data can be |
| 1599 // received before the data channel state changes to open. That is hard to test | 1598 // received before the data channel state changes to open. That is hard to test |
| 1600 // but the same buffering is used in that case. | 1599 // but the same buffering is used in that case. |
| 1601 TEST_F(P2PTestConductor, RegisterDataChannelObserver) { | 1600 TEST_F(P2PTestConductor, RegisterDataChannelObserver) { |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1958 server.urls.push_back("stun:hostname"); | 1957 server.urls.push_back("stun:hostname"); |
| 1959 server.urls.push_back("turn:hostname"); | 1958 server.urls.push_back("turn:hostname"); |
| 1960 servers.push_back(server); | 1959 servers.push_back(server); |
| 1961 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_configurations_, | 1960 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_configurations_, |
| 1962 &turn_configurations_)); | 1961 &turn_configurations_)); |
| 1963 EXPECT_EQ(1U, stun_configurations_.size()); | 1962 EXPECT_EQ(1U, stun_configurations_.size()); |
| 1964 EXPECT_EQ(1U, turn_configurations_.size()); | 1963 EXPECT_EQ(1U, turn_configurations_.size()); |
| 1965 } | 1964 } |
| 1966 | 1965 |
| 1967 #endif // if !defined(THREAD_SANITIZER) | 1966 #endif // if !defined(THREAD_SANITIZER) |
| OLD | NEW |