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

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

Issue 1027693004: Delete the ClientSocketPoolHistograms class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small xml fix Created 5 years, 9 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
« no previous file with comments | « net/socket/client_socket_pool_manager_impl.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) 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 "net/socket/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 TestCompletionCallback write_callback_; 51 TestCompletionCallback write_callback_;
52 StreamSocket* sock_; 52 StreamSocket* sock_;
53 scoped_ptr<DeterministicSocketData> data_; 53 scoped_ptr<DeterministicSocketData> data_;
54 54
55 private: 55 private:
56 scoped_refptr<IOBuffer> read_buf_; 56 scoped_refptr<IOBuffer> read_buf_;
57 MockConnect connect_data_; 57 MockConnect connect_data_;
58 58
59 HostPortPair endpoint_; 59 HostPortPair endpoint_;
60 scoped_refptr<TransportSocketParams> tcp_params_; 60 scoped_refptr<TransportSocketParams> tcp_params_;
61 ClientSocketPoolHistograms histograms_;
62 DeterministicMockClientSocketFactory socket_factory_; 61 DeterministicMockClientSocketFactory socket_factory_;
63 MockTransportClientSocketPool socket_pool_; 62 MockTransportClientSocketPool socket_pool_;
64 ClientSocketHandle connection_; 63 ClientSocketHandle connection_;
65 64
66 DISALLOW_COPY_AND_ASSIGN(DeterministicSocketDataTest); 65 DISALLOW_COPY_AND_ASSIGN(DeterministicSocketDataTest);
67 }; 66 };
68 67
69 DeterministicSocketDataTest::DeterministicSocketDataTest() 68 DeterministicSocketDataTest::DeterministicSocketDataTest()
70 : sock_(NULL), 69 : sock_(NULL),
71 read_buf_(NULL), 70 read_buf_(NULL),
72 connect_data_(SYNCHRONOUS, OK), 71 connect_data_(SYNCHRONOUS, OK),
73 endpoint_("www.google.com", 443), 72 endpoint_("www.google.com", 443),
74 tcp_params_(new TransportSocketParams( 73 tcp_params_(new TransportSocketParams(
75 endpoint_, 74 endpoint_,
76 false, 75 false,
77 false, 76 false,
78 OnHostResolutionCallback(), 77 OnHostResolutionCallback(),
79 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)), 78 TransportSocketParams::COMBINE_CONNECT_AND_WRITE_DEFAULT)),
80 histograms_(std::string()), 79 socket_pool_(10, 10, &socket_factory_) {
81 socket_pool_(10, 10, &histograms_, &socket_factory_) {} 80 }
82 81
83 void DeterministicSocketDataTest::TearDown() { 82 void DeterministicSocketDataTest::TearDown() {
84 // Empty the current queue. 83 // Empty the current queue.
85 base::MessageLoop::current()->RunUntilIdle(); 84 base::MessageLoop::current()->RunUntilIdle();
86 PlatformTest::TearDown(); 85 PlatformTest::TearDown();
87 } 86 }
88 87
89 void DeterministicSocketDataTest::Initialize(MockRead* reads, 88 void DeterministicSocketDataTest::Initialize(MockRead* reads,
90 size_t reads_count, 89 size_t reads_count,
91 MockWrite* writes, 90 MockWrite* writes,
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 data_->StopAfter(1); 612 data_->StopAfter(1);
614 AssertSyncWriteEquals(kMsg3, kLen3); 613 AssertSyncWriteEquals(kMsg3, kLen3);
615 614
616 data_->RunFor(1); 615 data_->RunFor(1);
617 ASSERT_TRUE(read_callback_.have_result()); 616 ASSERT_TRUE(read_callback_.have_result());
618 ASSERT_EQ(kLen2, read_callback_.WaitForResult()); 617 ASSERT_EQ(kLen2, read_callback_.WaitForResult());
619 AssertReadBufferEquals(kMsg2, kLen2); 618 AssertReadBufferEquals(kMsg2, kLen2);
620 } 619 }
621 620
622 } // namespace net 621 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_manager_impl.cc ('k') | net/socket/socket_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698