| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 |
| 11 // Tests for the UdpSocketWrapper interface. | 11 // Tests for the UdpSocketWrapper interface. |
| 12 // This will test the UdpSocket implementations on various platforms. | 12 // This will test the UdpSocket implementations on various platforms. |
| 13 // Note that this test is using a real SocketManager, which starts up | 13 // Note that this test is using a real SocketManager, which starts up |
| 14 // an extra worker thread, making the testing more complex than it | 14 // an extra worker thread, making the testing more complex than it |
| 15 // should be. | 15 // should be. |
| 16 // This is because on Posix, the CloseBlocking function waits for the | 16 // This is because on Posix, the CloseBlocking function waits for the |
| 17 // ReadyForDeletion function to be called, which has to be called after | 17 // ReadyForDeletion function to be called, which has to be called after |
| 18 // CloseBlocking, and thus has to be called from another thread. | 18 // CloseBlocking, and thus has to be called from another thread. |
| 19 // The manager is the one actually doing the deleting. | 19 // The manager is the one actually doing the deleting. |
| 20 // This is done differently in the Winsock2 code, but that code | 20 // This is done differently in the Winsock2 code, but that code |
| 21 // will also hang if the destructor is called directly. | 21 // will also hang if the destructor is called directly. |
| 22 | 22 |
| 23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "webrtc/test/gmock.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "webrtc/test/gtest.h" |
| 25 #include "webrtc/voice_engine/test/channel_transport/udp_socket_manager_wrapper.
h" | 25 #include "webrtc/voice_engine/test/channel_transport/udp_socket_manager_wrapper.
h" |
| 26 #include "webrtc/voice_engine/test/channel_transport/udp_socket_wrapper.h" | 26 #include "webrtc/voice_engine/test/channel_transport/udp_socket_wrapper.h" |
| 27 | 27 |
| 28 using ::testing::_; | 28 using ::testing::_; |
| 29 using ::testing::Return; | 29 using ::testing::Return; |
| 30 | 30 |
| 31 namespace webrtc { | 31 namespace webrtc { |
| 32 namespace test { | 32 namespace test { |
| 33 | 33 |
| 34 class MockSocketManager : public UdpSocketManager { | 34 class MockSocketManager : public UdpSocketManager { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 58 NULL, // CallbackObj | 58 NULL, // CallbackObj |
| 59 NULL, // IncomingSocketCallback | 59 NULL, // IncomingSocketCallback |
| 60 false, // ipV6Enable | 60 false, // ipV6Enable |
| 61 false); // disableGQOS | 61 false); // disableGQOS |
| 62 socket->CloseBlocking(); | 62 socket->CloseBlocking(); |
| 63 UdpSocketManager::Return(); | 63 UdpSocketManager::Return(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace test | 66 } // namespace test |
| 67 } // namespace webrtc | 67 } // namespace webrtc |
| OLD | NEW |