| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop_proxy.h" |
| 8 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 9 #include "base/time.h" | 10 #include "base/time.h" |
| 10 #include "base/test/test_timeouts.h" | 11 #include "base/test/test_timeouts.h" |
| 11 #include "crypto/nss_util.h" | 12 #include "crypto/nss_util.h" |
| 12 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
| 13 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 14 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
| 15 #include "net/socket/socket.h" | 16 #include "net/socket/socket.h" |
| 16 #include "net/socket/stream_socket.h" | 17 #include "net/socket/stream_socket.h" |
| 17 #include "remoting/protocol/jingle_session.h" | 18 #include "remoting/protocol/jingle_session.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 scoped_ptr<crypto::RSAPrivateKey> private_key( | 170 scoped_ptr<crypto::RSAPrivateKey> private_key( |
| 170 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); | 171 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); |
| 171 | 172 |
| 172 host_signal_strategy_.reset(new FakeSignalStrategy(kHostJid)); | 173 host_signal_strategy_.reset(new FakeSignalStrategy(kHostJid)); |
| 173 client_signal_strategy_.reset(new FakeSignalStrategy(kClientJid)); | 174 client_signal_strategy_.reset(new FakeSignalStrategy(kClientJid)); |
| 174 FakeSignalStrategy::Connect(host_signal_strategy_.get(), | 175 FakeSignalStrategy::Connect(host_signal_strategy_.get(), |
| 175 client_signal_strategy_.get()); | 176 client_signal_strategy_.get()); |
| 176 | 177 |
| 177 EXPECT_CALL(host_server_listener_, OnSessionManagerInitialized()) | 178 EXPECT_CALL(host_server_listener_, OnSessionManagerInitialized()) |
| 178 .Times(1); | 179 .Times(1); |
| 179 host_server_.reset(JingleSessionManager::CreateNotSandboxed()); | 180 host_server_.reset(JingleSessionManager::CreateNotSandboxed( |
| 181 base::MessageLoopProxy::CreateForCurrentThread())); |
| 180 host_server_->set_allow_local_ips(true); | 182 host_server_->set_allow_local_ips(true); |
| 181 host_server_->Init( | 183 host_server_->Init( |
| 182 kHostJid, host_signal_strategy_.get(), &host_server_listener_, | 184 kHostJid, host_signal_strategy_.get(), &host_server_listener_, |
| 183 private_key.release(), cert_der, false); | 185 private_key.release(), cert_der, false); |
| 184 | 186 |
| 185 EXPECT_CALL(client_server_listener_, OnSessionManagerInitialized()) | 187 EXPECT_CALL(client_server_listener_, OnSessionManagerInitialized()) |
| 186 .Times(1); | 188 .Times(1); |
| 187 client_server_.reset(JingleSessionManager::CreateNotSandboxed()); | 189 client_server_.reset(JingleSessionManager::CreateNotSandboxed( |
| 190 base::MessageLoopProxy::CreateForCurrentThread())); |
| 188 client_server_->set_allow_local_ips(true); | 191 client_server_->set_allow_local_ips(true); |
| 189 client_server_->Init( | 192 client_server_->Init( |
| 190 kClientJid, client_signal_strategy_.get(), &client_server_listener_, | 193 kClientJid, client_signal_strategy_.get(), &client_server_listener_, |
| 191 NULL, "", false); | 194 NULL, "", false); |
| 192 } | 195 } |
| 193 | 196 |
| 194 void CloseSessionManager() { | 197 void CloseSessionManager() { |
| 195 if (host_server_.get()) { | 198 if (host_server_.get()) { |
| 196 host_server_->Close(); | 199 host_server_->Close(); |
| 197 host_server_.reset(); | 200 host_server_.reset(); |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 ASSERT_TRUE(tester->WaitFinished()); | 788 ASSERT_TRUE(tester->WaitFinished()); |
| 786 LOG(INFO) << "Time for 500k bytes " | 789 LOG(INFO) << "Time for 500k bytes " |
| 787 << tester->GetElapsedTime().InMilliseconds() << " ms."; | 790 << tester->GetElapsedTime().InMilliseconds() << " ms."; |
| 788 | 791 |
| 789 // Connections must be closed while |tester| still exists. | 792 // Connections must be closed while |tester| still exists. |
| 790 CloseSessions(); | 793 CloseSessions(); |
| 791 } | 794 } |
| 792 | 795 |
| 793 } // namespace protocol | 796 } // namespace protocol |
| 794 } // namespace remoting | 797 } // namespace remoting |
| OLD | NEW |