OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |