OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/timer/mock_timer.h" | 7 #include "base/timer/mock_timer.h" |
8 #include "net/socket/stream_listen_socket.h" | 8 #include "net/socket/stream_listen_socket.h" |
9 #include "remoting/host/gnubby_auth_handler_posix.h" | 9 #include "remoting/host/gnubby_auth_handler_posix.h" |
10 #include "remoting/host/gnubby_socket.h" | 10 #include "remoting/host/gnubby_socket.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 0x20, 0x3c, 0x00, 0xc6, 0xe1, 0x73, 0x34, 0xe2, 0x23, 0x99, 0xc4, 0xfa, | 35 0x20, 0x3c, 0x00, 0xc6, 0xe1, 0x73, 0x34, 0xe2, 0x23, 0x99, 0xc4, 0xfa, |
36 0x91, 0xc2, 0xd5, 0x97, 0xc1, 0x8b, 0xd0, 0x3c, 0x13, 0xba, 0xf0, 0xd7, | 36 0x91, 0xc2, 0xd5, 0x97, 0xc1, 0x8b, 0xd0, 0x3c, 0x13, 0xba, 0xf0, 0xd7, |
37 0x5e, 0xa3, 0xbc, 0x02, 0x5b, 0xec, 0xe4, 0x4b, 0xae, 0x0e, 0xf2, 0xbd, | 37 0x5e, 0xa3, 0xbc, 0x02, 0x5b, 0xec, 0xe4, 0x4b, 0xae, 0x0e, 0xf2, 0xbd, |
38 0xc8, 0xaa}; | 38 0xc8, 0xaa}; |
39 | 39 |
40 class MockStreamListenSocket : public net::StreamListenSocket { | 40 class MockStreamListenSocket : public net::StreamListenSocket { |
41 public: | 41 public: |
42 explicit MockStreamListenSocket(net::StreamListenSocket::Delegate* delegate) | 42 explicit MockStreamListenSocket(net::StreamListenSocket::Delegate* delegate) |
43 : StreamListenSocket(net::kInvalidSocket, delegate) {} | 43 : StreamListenSocket(net::kInvalidSocket, delegate) {} |
44 | 44 |
45 virtual void Accept() override { NOTREACHED(); } | 45 void Accept() override { NOTREACHED(); } |
46 | 46 |
47 private: | 47 private: |
48 virtual ~MockStreamListenSocket() {} | 48 ~MockStreamListenSocket() override {} |
49 }; | 49 }; |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 class GnubbyAuthHandlerPosixTest : public testing::Test { | 53 class GnubbyAuthHandlerPosixTest : public testing::Test { |
54 public: | 54 public: |
55 GnubbyAuthHandlerPosixTest() {} | 55 GnubbyAuthHandlerPosixTest() {} |
56 | 56 |
57 virtual void SetUp() override; | 57 virtual void SetUp() override; |
58 | 58 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 std::string error_json = base::StringPrintf( | 156 std::string error_json = base::StringPrintf( |
157 "{\"type\":\"error\",\"connectionId\":%d}", | 157 "{\"type\":\"error\",\"connectionId\":%d}", |
158 auth_handler_posix_->GetConnectionIdForTesting(socket)); | 158 auth_handler_posix_->GetConnectionIdForTesting(socket)); |
159 | 159 |
160 ASSERT_TRUE(auth_handler_posix_->HasActiveSocketForTesting(socket)); | 160 ASSERT_TRUE(auth_handler_posix_->HasActiveSocketForTesting(socket)); |
161 auth_handler_->DeliverClientMessage(error_json); | 161 auth_handler_->DeliverClientMessage(error_json); |
162 ASSERT_FALSE(auth_handler_posix_->HasActiveSocketForTesting(socket)); | 162 ASSERT_FALSE(auth_handler_posix_->HasActiveSocketForTesting(socket)); |
163 } | 163 } |
164 | 164 |
165 } // namespace remoting | 165 } // namespace remoting |
OLD | NEW |