OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/jingle_glue/chromium_socket_factory.h" | 5 #include "remoting/protocol/chromium_socket_factory.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" | 11 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" |
12 #include "third_party/libjingle/source/talk/base/socketaddress.h" | 12 #include "third_party/libjingle/source/talk/base/socketaddress.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
| 15 namespace protocol { |
15 | 16 |
16 class ChromiumSocketFactoryTest : public testing::Test, | 17 class ChromiumSocketFactoryTest : public testing::Test, |
17 public sigslot::has_slots<> { | 18 public sigslot::has_slots<> { |
18 public: | 19 public: |
19 virtual void SetUp() OVERRIDE { | 20 virtual void SetUp() OVERRIDE { |
20 socket_factory_.reset(new ChromiumPacketSocketFactory()); | 21 socket_factory_.reset(new ChromiumPacketSocketFactory()); |
21 | 22 |
22 socket_.reset(socket_factory_->CreateUdpSocket( | 23 socket_.reset(socket_factory_->CreateUdpSocket( |
23 talk_base::SocketAddress("127.0.0.1", 0), 0, 0)); | 24 talk_base::SocketAddress("127.0.0.1", 0), 0, 0)); |
24 ASSERT_TRUE(socket_.get() != NULL); | 25 ASSERT_TRUE(socket_.get() != NULL); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // IPv4 address. This send is expected to fail, but the socket should still be | 104 // IPv4 address. This send is expected to fail, but the socket should still be |
104 // functional. | 105 // functional. |
105 sending_socket->SendTo(test_packet.data(), test_packet.size(), | 106 sending_socket->SendTo(test_packet.data(), test_packet.size(), |
106 talk_base::SocketAddress("::1", 0), | 107 talk_base::SocketAddress("::1", 0), |
107 talk_base::PacketOptions()); | 108 talk_base::PacketOptions()); |
108 | 109 |
109 // Verify that socket is still usable. | 110 // Verify that socket is still usable. |
110 VerifyCanSendAndReceive(sending_socket.get()); | 111 VerifyCanSendAndReceive(sending_socket.get()); |
111 } | 112 } |
112 | 113 |
| 114 } // namespace protocol |
113 } // namespace remoting | 115 } // namespace remoting |
OLD | NEW |