OLD | NEW |
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_cache.h" | 5 #include "net/http/http_cache.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 int result; | 491 int result; |
492 net::TestCompletionCallback callback; | 492 net::TestCompletionCallback callback; |
493 scoped_ptr<net::HttpTransaction> trans; | 493 scoped_ptr<net::HttpTransaction> trans; |
494 }; | 494 }; |
495 | 495 |
496 class FakeWebSocketHandshakeStreamCreateHelper | 496 class FakeWebSocketHandshakeStreamCreateHelper |
497 : public net::WebSocketHandshakeStreamBase::CreateHelper { | 497 : public net::WebSocketHandshakeStreamBase::CreateHelper { |
498 public: | 498 public: |
499 virtual ~FakeWebSocketHandshakeStreamCreateHelper() {} | 499 virtual ~FakeWebSocketHandshakeStreamCreateHelper() {} |
500 virtual net::WebSocketHandshakeStreamBase* CreateBasicStream( | 500 virtual net::WebSocketHandshakeStreamBase* CreateBasicStream( |
501 scoped_ptr<net::ClientSocketHandle> connect, bool using_proxy) OVERRIDE { | 501 scoped_ptr<net::ClientSocketHandle> connect, bool using_proxy) override { |
502 return NULL; | 502 return NULL; |
503 } | 503 } |
504 virtual net::WebSocketHandshakeStreamBase* CreateSpdyStream( | 504 virtual net::WebSocketHandshakeStreamBase* CreateSpdyStream( |
505 const base::WeakPtr<net::SpdySession>& session, | 505 const base::WeakPtr<net::SpdySession>& session, |
506 bool use_relative_url) OVERRIDE { | 506 bool use_relative_url) override { |
507 return NULL; | 507 return NULL; |
508 } | 508 } |
509 }; | 509 }; |
510 | 510 |
511 // Returns true if |entry| is not one of the log types paid attention to in this | 511 // Returns true if |entry| is not one of the log types paid attention to in this |
512 // test. Note that TYPE_HTTP_CACHE_WRITE_INFO and TYPE_HTTP_CACHE_*_DATA are | 512 // test. Note that TYPE_HTTP_CACHE_WRITE_INFO and TYPE_HTTP_CACHE_*_DATA are |
513 // ignored. | 513 // ignored. |
514 bool ShouldIgnoreLogEntry(const net::CapturingNetLog::CapturedEntry& entry) { | 514 bool ShouldIgnoreLogEntry(const net::CapturingNetLog::CapturedEntry& entry) { |
515 switch (entry.type) { | 515 switch (entry.type) { |
516 case net::NetLog::TYPE_HTTP_CACHE_GET_BACKEND: | 516 case net::NetLog::TYPE_HTTP_CACHE_GET_BACKEND: |
(...skipping 6766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7283 // A second transaction on a different part of the file (the default | 7283 // A second transaction on a different part of the file (the default |
7284 // kRangeGET_TransactionOK requests 40-49) should not be blocked by | 7284 // kRangeGET_TransactionOK requests 40-49) should not be blocked by |
7285 // the already pending transaction. | 7285 // the already pending transaction. |
7286 RunTransactionTest(cache.http_cache(), kRangeGET_TransactionOK); | 7286 RunTransactionTest(cache.http_cache(), kRangeGET_TransactionOK); |
7287 | 7287 |
7288 // Let the first transaction complete. | 7288 // Let the first transaction complete. |
7289 callback.WaitForResult(); | 7289 callback.WaitForResult(); |
7290 | 7290 |
7291 RemoveMockTransaction(&transaction); | 7291 RemoveMockTransaction(&transaction); |
7292 } | 7292 } |
OLD | NEW |