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

Side by Side Diff: net/socket/deterministic_socket_data_unittest.cc

Issue 8898036: base::Bind: Convert proxy_resolving_client_socket.[cc,h] and deps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Possible test fix. Created 9 years 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
« no previous file with comments | « net/socket/client_socket_pool_manager.cc ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/socket/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include "testing/platform_test.h" 7 #include "testing/platform_test.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 //----------------------------------------------------------------------------- 10 //-----------------------------------------------------------------------------
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 size_t writes_count) { 86 size_t writes_count) {
87 data_ = new DeterministicSocketData(reads, reads_count, writes, writes_count); 87 data_ = new DeterministicSocketData(reads, reads_count, writes, writes_count);
88 data_->set_connect_data(connect_data_); 88 data_->set_connect_data(connect_data_);
89 socket_factory_.AddSocketDataProvider(data_.get()); 89 socket_factory_.AddSocketDataProvider(data_.get());
90 90
91 // Perform the TCP connect 91 // Perform the TCP connect
92 EXPECT_EQ(OK, 92 EXPECT_EQ(OK,
93 connection_.Init(endpoint_.ToString(), 93 connection_.Init(endpoint_.ToString(),
94 tcp_params_, 94 tcp_params_,
95 LOWEST, 95 LOWEST,
96 NULL, 96 CompletionCallback(),
97 reinterpret_cast<TransportClientSocketPool*>(&socket_pool_), 97 reinterpret_cast<TransportClientSocketPool*>(&socket_pool_),
98 BoundNetLog())); 98 BoundNetLog()));
99 sock_ = connection_.socket(); 99 sock_ = connection_.socket();
100 } 100 }
101 101
102 void DeterministicSocketDataTest::AssertSyncReadEquals(const char* data, 102 void DeterministicSocketDataTest::AssertSyncReadEquals(const char* data,
103 int len) { 103 int len) {
104 // Issue the read, which will complete immediately 104 // Issue the read, which will complete immediately
105 AssertReadReturns(data, len, len); 105 AssertReadReturns(data, len, len);
106 AssertReadBufferEquals(data, len); 106 AssertReadBufferEquals(data, len);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // Issue the writes which will complete immediately 523 // Issue the writes which will complete immediately
524 data_->StopAfter(1); 524 data_->StopAfter(1);
525 AssertSyncWriteEquals(kMsg3, kLen3); 525 AssertSyncWriteEquals(kMsg3, kLen3);
526 526
527 data_->RunFor(1); 527 data_->RunFor(1);
528 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); 528 ASSERT_EQ(kLen2, read_callback_.WaitForResult());
529 AssertReadBufferEquals(kMsg2, kLen2); 529 AssertReadBufferEquals(kMsg2, kLen2);
530 } 530 }
531 531
532 } // namespace net 532 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_manager.cc ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698