| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "jingle/glue/pseudotcp_adapter.h" | 5 #include "jingle/glue/pseudotcp_adapter.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 scoped_refptr<net::DrainableIOBuffer> output_buffer_; | 296 scoped_refptr<net::DrainableIOBuffer> output_buffer_; |
| 297 scoped_refptr<net::GrowableIOBuffer> input_buffer_; | 297 scoped_refptr<net::GrowableIOBuffer> input_buffer_; |
| 298 | 298 |
| 299 int write_errors_; | 299 int write_errors_; |
| 300 int read_errors_; | 300 int read_errors_; |
| 301 }; | 301 }; |
| 302 | 302 |
| 303 class PseudoTcpAdapterTest : public testing::Test { | 303 class PseudoTcpAdapterTest : public testing::Test { |
| 304 protected: | 304 protected: |
| 305 virtual void SetUp() OVERRIDE { | 305 virtual void SetUp() OVERRIDE { |
| 306 JingleThreadWrapper::EnsureForCurrentThread(); | 306 JingleThreadWrapper::EnsureForCurrentMessageLoop(); |
| 307 | 307 |
| 308 host_socket_ = new FakeSocket(); | 308 host_socket_ = new FakeSocket(); |
| 309 client_socket_ = new FakeSocket(); | 309 client_socket_ = new FakeSocket(); |
| 310 | 310 |
| 311 host_socket_->Connect(client_socket_); | 311 host_socket_->Connect(client_socket_); |
| 312 client_socket_->Connect(host_socket_); | 312 client_socket_->Connect(host_socket_); |
| 313 | 313 |
| 314 host_pseudotcp_.reset(new PseudoTcpAdapter(host_socket_)); | 314 host_pseudotcp_.reset(new PseudoTcpAdapter(host_socket_)); |
| 315 client_pseudotcp_.reset(new PseudoTcpAdapter(client_socket_)); | 315 client_pseudotcp_.reset(new PseudoTcpAdapter(client_socket_)); |
| 316 } | 316 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 client_pseudotcp_.get()); | 437 client_pseudotcp_.get()); |
| 438 | 438 |
| 439 tester->Start(); | 439 tester->Start(); |
| 440 message_loop_.Run(); | 440 message_loop_.Run(); |
| 441 tester->CheckResults(); | 441 tester->CheckResults(); |
| 442 } | 442 } |
| 443 | 443 |
| 444 } // namespace | 444 } // namespace |
| 445 | 445 |
| 446 } // namespace jingle_glue | 446 } // namespace jingle_glue |
| OLD | NEW |