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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 private: | 47 private: |
48 ~MockStreamListenSocket() override {} | 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 void SetUp() override; |
58 | 58 |
59 protected: | 59 protected: |
60 // Object under test. | 60 // Object under test. |
61 scoped_ptr<GnubbyAuthHandlerPosix> auth_handler_posix_; | 61 scoped_ptr<GnubbyAuthHandlerPosix> auth_handler_posix_; |
62 | 62 |
63 // GnubbyAuthHandler interface for |auth_handler_posix_|. | 63 // GnubbyAuthHandler interface for |auth_handler_posix_|. |
64 GnubbyAuthHandler* auth_handler_; | 64 GnubbyAuthHandler* auth_handler_; |
65 | 65 |
66 // Stream delegate interface for |auth_handler_posix_|. | 66 // Stream delegate interface for |auth_handler_posix_|. |
67 net::StreamListenSocket::Delegate* delegate_; | 67 net::StreamListenSocket::Delegate* delegate_; |
(...skipping 88 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 |