Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: remoting/protocol/jingle_session_unittest.cc

Issue 7312013: Minor cleanups in JingleSession and JingleSessionManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/path_service.h" 8 #include "base/path_service.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 reinterpret_cast<const uint8*>(key_string.data() + 167 reinterpret_cast<const uint8*>(key_string.data() +
168 key_string.length())); 168 key_string.length()));
169 scoped_ptr<crypto::RSAPrivateKey> private_key( 169 scoped_ptr<crypto::RSAPrivateKey> private_key(
170 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector)); 170 crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_vector));
171 171
172 host_signal_strategy_.reset(new FakeSignalStrategy(kHostJid)); 172 host_signal_strategy_.reset(new FakeSignalStrategy(kHostJid));
173 client_signal_strategy_.reset(new FakeSignalStrategy(kClientJid)); 173 client_signal_strategy_.reset(new FakeSignalStrategy(kClientJid));
174 FakeSignalStrategy::Connect(host_signal_strategy_.get(), 174 FakeSignalStrategy::Connect(host_signal_strategy_.get(),
175 client_signal_strategy_.get()); 175 client_signal_strategy_.get());
176 176
177 host_server_.reset(new JingleSessionManager(NULL, NULL, NULL)); 177 host_server_.reset(JingleSessionManager::CreateNotSandboxed());
178 host_server_->set_allow_local_ips(true); 178 host_server_->set_allow_local_ips(true);
179 host_server_->Init( 179 host_server_->Init(
180 kHostJid, host_signal_strategy_.get(), 180 kHostJid, host_signal_strategy_.get(),
181 NewCallback(&host_server_callback_, 181 NewCallback(&host_server_callback_,
182 &MockSessionManagerCallback::OnIncomingSession), 182 &MockSessionManagerCallback::OnIncomingSession),
183 private_key.release(), 183 private_key.release(),
184 cert); 184 cert);
185 185
186 client_server_.reset(new JingleSessionManager(NULL, NULL, NULL)); 186 client_server_.reset(JingleSessionManager::CreateNotSandboxed());
187 client_server_->set_allow_local_ips(true); 187 client_server_->set_allow_local_ips(true);
188 client_server_->Init( 188 client_server_->Init(
189 kClientJid, client_signal_strategy_.get(), 189 kClientJid, client_signal_strategy_.get(),
190 NewCallback(&client_server_callback_, 190 NewCallback(&client_server_callback_,
191 &MockSessionManagerCallback::OnIncomingSession), 191 &MockSessionManagerCallback::OnIncomingSession),
192 NULL, NULL); 192 NULL, NULL);
193 } 193 }
194 194
195 void CloseSessionManager() { 195 void CloseSessionManager() {
196 if (host_server_.get()) { 196 if (host_server_.get()) {
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 << tester->GetElapsedTime().InMilliseconds() << " ms."; 743 << tester->GetElapsedTime().InMilliseconds() << " ms.";
744 744
745 // Connections must be closed while |tester| still exists. 745 // Connections must be closed while |tester| still exists.
746 CloseSessions(); 746 CloseSessions();
747 } 747 }
748 748
749 #endif 749 #endif
750 750
751 } // namespace protocol 751 } // namespace protocol
752 } // namespace remoting 752 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698