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

Side by Side Diff: net/websockets/websocket_job_test.cc

Issue 379293002: Add AssertNoURLRequests() to URLRequestContext subclass destructors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to two omitted subclasses of subclasses of URLRequestContext. Created 6 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
« no previous file with comments | « net/url_request/view_cache_helper_unittest.cc ('k') | sync/internal_api/http_bridge.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/websockets/websocket_job.h" 5 #include "net/websockets/websocket_job.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 explicit MockURLRequestContext(CookieStore* cookie_store) 259 explicit MockURLRequestContext(CookieStore* cookie_store)
260 : transport_security_state_() { 260 : transport_security_state_() {
261 set_cookie_store(cookie_store); 261 set_cookie_store(cookie_store);
262 set_transport_security_state(&transport_security_state_); 262 set_transport_security_state(&transport_security_state_);
263 base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000); 263 base::Time expiry = base::Time::Now() + base::TimeDelta::FromDays(1000);
264 bool include_subdomains = false; 264 bool include_subdomains = false;
265 transport_security_state_.AddHSTS("upgrademe.com", expiry, 265 transport_security_state_.AddHSTS("upgrademe.com", expiry,
266 include_subdomains); 266 include_subdomains);
267 } 267 }
268 268
269 virtual ~MockURLRequestContext() {} 269 virtual ~MockURLRequestContext() {
270 AssertNoURLRequests();
271 }
270 272
271 private: 273 private:
272 TransportSecurityState transport_security_state_; 274 TransportSecurityState transport_security_state_;
273 }; 275 };
274 276
275 class MockHttpTransactionFactory : public HttpTransactionFactory { 277 class MockHttpTransactionFactory : public HttpTransactionFactory {
276 public: 278 public:
277 MockHttpTransactionFactory(NextProto next_proto, 279 MockHttpTransactionFactory(NextProto next_proto,
278 OrderedSocketData* data, 280 OrderedSocketData* data,
279 bool enable_websocket_over_spdy) { 281 bool enable_websocket_over_spdy) {
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 job()->Connect(); 1285 job()->Connect();
1284 SetDeleteNext(); 1286 SetDeleteNext();
1285 job()->OnReceivedData( 1287 job()->OnReceivedData(
1286 socket_.get(), kMinimalResponse, arraysize(kMinimalResponse) - 1); 1288 socket_.get(), kMinimalResponse, arraysize(kMinimalResponse) - 1);
1287 EXPECT_FALSE(job()); 1289 EXPECT_FALSE(job());
1288 } 1290 }
1289 1291
1290 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation. 1292 // TODO(toyoshim): Add tests to verify throttling, SPDY stream limitation.
1291 // TODO(toyoshim,yutak): Add tests to verify closing handshake. 1293 // TODO(toyoshim,yutak): Add tests to verify closing handshake.
1292 } // namespace net 1294 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/view_cache_helper_unittest.cc ('k') | sync/internal_api/http_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698