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

Side by Side Diff: net/http/http_response_body_drainer_unittest.cc

Issue 623213004: replace OVERRIDE and FINAL with override and final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo unwanted change in comment Created 6 years, 2 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
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/http/http_response_body_drainer.h" 5 #include "net/http/http_response_body_drainer.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 is_sync_(false), 73 is_sync_(false),
74 is_last_chunk_zero_size_(false), 74 is_last_chunk_zero_size_(false),
75 is_complete_(false), 75 is_complete_(false),
76 weak_factory_(this) {} 76 weak_factory_(this) {}
77 virtual ~MockHttpStream() {} 77 virtual ~MockHttpStream() {}
78 78
79 // HttpStream implementation. 79 // HttpStream implementation.
80 virtual int InitializeStream(const HttpRequestInfo* request_info, 80 virtual int InitializeStream(const HttpRequestInfo* request_info,
81 RequestPriority priority, 81 RequestPriority priority,
82 const BoundNetLog& net_log, 82 const BoundNetLog& net_log,
83 const CompletionCallback& callback) OVERRIDE { 83 const CompletionCallback& callback) override {
84 return ERR_UNEXPECTED; 84 return ERR_UNEXPECTED;
85 } 85 }
86 virtual int SendRequest(const HttpRequestHeaders& request_headers, 86 virtual int SendRequest(const HttpRequestHeaders& request_headers,
87 HttpResponseInfo* response, 87 HttpResponseInfo* response,
88 const CompletionCallback& callback) OVERRIDE { 88 const CompletionCallback& callback) override {
89 return ERR_UNEXPECTED; 89 return ERR_UNEXPECTED;
90 } 90 }
91 virtual UploadProgress GetUploadProgress() const OVERRIDE { 91 virtual UploadProgress GetUploadProgress() const override {
92 return UploadProgress(); 92 return UploadProgress();
93 } 93 }
94 virtual int ReadResponseHeaders(const CompletionCallback& callback) OVERRIDE { 94 virtual int ReadResponseHeaders(const CompletionCallback& callback) override {
95 return ERR_UNEXPECTED; 95 return ERR_UNEXPECTED;
96 } 96 }
97 97
98 virtual bool CanFindEndOfResponse() const OVERRIDE { return true; } 98 virtual bool CanFindEndOfResponse() const override { return true; }
99 virtual bool IsConnectionReused() const OVERRIDE { return false; } 99 virtual bool IsConnectionReused() const override { return false; }
100 virtual void SetConnectionReused() OVERRIDE {} 100 virtual void SetConnectionReused() override {}
101 virtual bool IsConnectionReusable() const OVERRIDE { return false; } 101 virtual bool IsConnectionReusable() const override { return false; }
102 virtual int64 GetTotalReceivedBytes() const OVERRIDE { return 0; } 102 virtual int64 GetTotalReceivedBytes() const override { return 0; }
103 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {} 103 virtual void GetSSLInfo(SSLInfo* ssl_info) override {}
104 virtual void GetSSLCertRequestInfo( 104 virtual void GetSSLCertRequestInfo(
105 SSLCertRequestInfo* cert_request_info) OVERRIDE {} 105 SSLCertRequestInfo* cert_request_info) override {}
106 106
107 // Mocked API 107 // Mocked API
108 virtual int ReadResponseBody(IOBuffer* buf, int buf_len, 108 virtual int ReadResponseBody(IOBuffer* buf, int buf_len,
109 const CompletionCallback& callback) OVERRIDE; 109 const CompletionCallback& callback) override;
110 virtual void Close(bool not_reusable) OVERRIDE { 110 virtual void Close(bool not_reusable) override {
111 CHECK(!closed_); 111 CHECK(!closed_);
112 closed_ = true; 112 closed_ = true;
113 result_waiter_->set_result(not_reusable); 113 result_waiter_->set_result(not_reusable);
114 } 114 }
115 115
116 virtual HttpStream* RenewStreamForAuth() OVERRIDE { 116 virtual HttpStream* RenewStreamForAuth() override {
117 return NULL; 117 return NULL;
118 } 118 }
119 119
120 virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } 120 virtual bool IsResponseBodyComplete() const override { return is_complete_; }
121 121
122 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } 122 virtual bool IsSpdyHttpStream() const override { return false; }
123 123
124 virtual bool GetLoadTimingInfo( 124 virtual bool GetLoadTimingInfo(
125 LoadTimingInfo* load_timing_info) const OVERRIDE { return false; } 125 LoadTimingInfo* load_timing_info) const override { return false; }
126 126
127 virtual void Drain(HttpNetworkSession*) OVERRIDE {} 127 virtual void Drain(HttpNetworkSession*) override {}
128 128
129 virtual void SetPriority(RequestPriority priority) OVERRIDE {} 129 virtual void SetPriority(RequestPriority priority) override {}
130 130
131 // Methods to tweak/observer mock behavior: 131 // Methods to tweak/observer mock behavior:
132 void set_stall_reads_forever() { stall_reads_forever_ = true; } 132 void set_stall_reads_forever() { stall_reads_forever_ = true; }
133 133
134 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } 134 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; }
135 135
136 void set_sync() { is_sync_ = true; } 136 void set_sync() { is_sync_ = true; }
137 137
138 void set_is_last_chunk_zero_size() { is_last_chunk_zero_size_ = true; } 138 void set_is_last_chunk_zero_size() { is_last_chunk_zero_size_ = true; }
139 139
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 too_many_chunks += 1; // Now it's too large. 302 too_many_chunks += 1; // Now it's too large.
303 303
304 mock_stream_->set_num_chunks(too_many_chunks); 304 mock_stream_->set_num_chunks(too_many_chunks);
305 drainer_->Start(session_.get()); 305 drainer_->Start(session_.get());
306 EXPECT_TRUE(result_waiter_.WaitForResult()); 306 EXPECT_TRUE(result_waiter_.WaitForResult());
307 } 307 }
308 308
309 } // namespace 309 } // namespace
310 310
311 } // namespace net 311 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket_pool_unittest.cc ('k') | net/http/http_server_properties_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698