| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 #include <memory> |
| 12 |
| 11 #include "webrtc/base/gunit.h" | 13 #include "webrtc/base/gunit.h" |
| 12 #include "webrtc/base/scoped_ptr.h" | |
| 13 #include "webrtc/base/socket_unittest.h" | 14 #include "webrtc/base/socket_unittest.h" |
| 14 #include "webrtc/base/thread.h" | 15 #include "webrtc/base/thread.h" |
| 15 #include "webrtc/base/macsocketserver.h" | 16 #include "webrtc/base/macsocketserver.h" |
| 16 | 17 |
| 17 namespace rtc { | 18 namespace rtc { |
| 18 | 19 |
| 19 class WakeThread : public Thread { | 20 class WakeThread : public Thread { |
| 20 public: | 21 public: |
| 21 WakeThread(SocketServer* ss) : ss_(ss) { | 22 WakeThread(SocketServer* ss) : ss_(ss) { |
| 22 } | 23 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Test that MacAsyncSocket passes all the generic Socket tests. | 92 // Test that MacAsyncSocket passes all the generic Socket tests. |
| 92 class MacAsyncSocketTest : public SocketTest { | 93 class MacAsyncSocketTest : public SocketTest { |
| 93 protected: | 94 protected: |
| 94 MacAsyncSocketTest() | 95 MacAsyncSocketTest() |
| 95 : server_(CreateSocketServer()), | 96 : server_(CreateSocketServer()), |
| 96 scope_(server_.get()) {} | 97 scope_(server_.get()) {} |
| 97 // Override for other implementations of MacBaseSocketServer. | 98 // Override for other implementations of MacBaseSocketServer. |
| 98 virtual MacBaseSocketServer* CreateSocketServer() { | 99 virtual MacBaseSocketServer* CreateSocketServer() { |
| 99 return new MacCFSocketServer(); | 100 return new MacCFSocketServer(); |
| 100 }; | 101 }; |
| 101 rtc::scoped_ptr<MacBaseSocketServer> server_; | 102 std::unique_ptr<MacBaseSocketServer> server_; |
| 102 SocketServerScope scope_; | 103 SocketServerScope scope_; |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 TEST_F(MacAsyncSocketTest, TestConnectIPv4) { | 106 TEST_F(MacAsyncSocketTest, TestConnectIPv4) { |
| 106 SocketTest::TestConnectIPv4(); | 107 SocketTest::TestConnectIPv4(); |
| 107 } | 108 } |
| 108 | 109 |
| 109 TEST_F(MacAsyncSocketTest, TestConnectIPv6) { | 110 TEST_F(MacAsyncSocketTest, TestConnectIPv6) { |
| 110 SocketTest::TestConnectIPv6(); | 111 SocketTest::TestConnectIPv6(); |
| 111 } | 112 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 230 |
| 230 TEST_F(MacCarbonAppAsyncSocketTest, TestSocketServerWaitIPv4) { | 231 TEST_F(MacCarbonAppAsyncSocketTest, TestSocketServerWaitIPv4) { |
| 231 SocketTest::TestSocketServerWaitIPv4(); | 232 SocketTest::TestSocketServerWaitIPv4(); |
| 232 } | 233 } |
| 233 | 234 |
| 234 TEST_F(MacCarbonAppAsyncSocketTest, TestSocketServerWaitIPv6) { | 235 TEST_F(MacCarbonAppAsyncSocketTest, TestSocketServerWaitIPv6) { |
| 235 SocketTest::TestSocketServerWaitIPv6(); | 236 SocketTest::TestSocketServerWaitIPv6(); |
| 236 } | 237 } |
| 237 #endif | 238 #endif |
| 238 } // namespace rtc | 239 } // namespace rtc |
| OLD | NEW |