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/jingle_glue/chromium_socket_factory.h" |
6 | 6 |
7 #include "base/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 | 15 |
16 class ChromiumSocketFactoryTest : public testing::Test, | 16 class ChromiumSocketFactoryTest : public testing::Test, |
17 public sigslot::has_slots<> { | 17 public sigslot::has_slots<> { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 const int kMaxPort = 12410; | 85 const int kMaxPort = 12410; |
86 socket_.reset(socket_factory_->CreateUdpSocket( | 86 socket_.reset(socket_factory_->CreateUdpSocket( |
87 talk_base::SocketAddress("127.0.0.1", 0), kMaxPort, kMaxPort)); | 87 talk_base::SocketAddress("127.0.0.1", 0), kMaxPort, kMaxPort)); |
88 ASSERT_TRUE(socket_.get() != NULL); | 88 ASSERT_TRUE(socket_.get() != NULL); |
89 EXPECT_EQ(socket_->GetState(), talk_base::AsyncPacketSocket::STATE_BOUND); | 89 EXPECT_EQ(socket_->GetState(), talk_base::AsyncPacketSocket::STATE_BOUND); |
90 EXPECT_GE(socket_->GetLocalAddress().port(), kMinPort); | 90 EXPECT_GE(socket_->GetLocalAddress().port(), kMinPort); |
91 EXPECT_LE(socket_->GetLocalAddress().port(), kMaxPort); | 91 EXPECT_LE(socket_->GetLocalAddress().port(), kMaxPort); |
92 } | 92 } |
93 | 93 |
94 } // namespace remoting | 94 } // namespace remoting |
OLD | NEW |