| 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/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/nss_util.h" | |
| 8 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 9 #include "base/time.h" | 8 #include "base/time.h" |
| 10 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 11 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
| 11 #include "crypto/nss_util.h" |
| 12 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
| 13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 #include "net/socket/socket.h" | 15 #include "net/socket/socket.h" |
| 16 #include "remoting/protocol/jingle_session.h" | 16 #include "remoting/protocol/jingle_session.h" |
| 17 #include "remoting/protocol/jingle_session_manager.h" | 17 #include "remoting/protocol/jingle_session_manager.h" |
| 18 #include "remoting/protocol/session_manager_pair.h" | 18 #include "remoting/protocol/session_manager_pair.h" |
| 19 #include "remoting/jingle_glue/jingle_thread.h" | 19 #include "remoting/jingle_glue/jingle_thread.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 net::X509Certificate::CreateFromBytes(cert_der.data(), | 131 net::X509Certificate::CreateFromBytes(cert_der.data(), |
| 132 cert_der.size()); | 132 cert_der.size()); |
| 133 | 133 |
| 134 FilePath key_path = certs_dir.AppendASCII("unittest.key.bin"); | 134 FilePath key_path = certs_dir.AppendASCII("unittest.key.bin"); |
| 135 std::string key_string; | 135 std::string key_string; |
| 136 ASSERT_TRUE(file_util::ReadFileToString(key_path, &key_string)); | 136 ASSERT_TRUE(file_util::ReadFileToString(key_path, &key_string)); |
| 137 std::vector<uint8> key_vector( | 137 std::vector<uint8> key_vector( |
| 138 reinterpret_cast<const uint8*>(key_string.data()), | 138 reinterpret_cast<const uint8*>(key_string.data()), |
| 139 reinterpret_cast<const uint8*>(key_string.data() + | 139 reinterpret_cast<const uint8*>(key_string.data() + |
| 140 key_string.length())); | 140 key_string.length())); |
| 141 scoped_ptr<base::RSAPrivateKey> private_key( | 141 scoped_ptr<crypto::RSAPrivateKey> private_key( |
| 142 base::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); | 142 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); |
| 143 | 143 |
| 144 session_manager_pair_ = new SessionManagerPair(&thread_); | 144 session_manager_pair_ = new SessionManagerPair(&thread_); |
| 145 session_manager_pair_->Init(); | 145 session_manager_pair_->Init(); |
| 146 host_server_ = new JingleSessionManager(&thread_); | 146 host_server_ = new JingleSessionManager(&thread_); |
| 147 host_server_->set_allow_local_ips(true); | 147 host_server_->set_allow_local_ips(true); |
| 148 host_server_->Init( | 148 host_server_->Init( |
| 149 SessionManagerPair::kHostJid, | 149 SessionManagerPair::kHostJid, |
| 150 session_manager_pair_->host_session_manager(), | 150 session_manager_pair_->host_session_manager(), |
| 151 NewCallback(&host_server_callback_, | 151 NewCallback(&host_server_callback_, |
| 152 &MockSessionManagerCallback::OnIncomingSession), | 152 &MockSessionManagerCallback::OnIncomingSession), |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 tester->CheckResults(); | 649 tester->CheckResults(); |
| 650 | 650 |
| 651 // Connections must be closed while |tester| still exists. | 651 // Connections must be closed while |tester| still exists. |
| 652 CloseSessions(); | 652 CloseSessions(); |
| 653 } | 653 } |
| 654 | 654 |
| 655 #endif | 655 #endif |
| 656 | 656 |
| 657 } // namespace protocol | 657 } // namespace protocol |
| 658 } // namespace remoting | 658 } // namespace remoting |
| OLD | NEW |