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

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

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, addressed sleevi comments Created 4 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
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/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <limits> 10 #include <limits>
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 CaptureGroupNameHttpProxySocketPool; 624 CaptureGroupNameHttpProxySocketPool;
625 typedef CaptureGroupNameSocketPool<SOCKSClientSocketPool> 625 typedef CaptureGroupNameSocketPool<SOCKSClientSocketPool>
626 CaptureGroupNameSOCKSSocketPool; 626 CaptureGroupNameSOCKSSocketPool;
627 typedef CaptureGroupNameSocketPool<SSLClientSocketPool> 627 typedef CaptureGroupNameSocketPool<SSLClientSocketPool>
628 CaptureGroupNameSSLSocketPool; 628 CaptureGroupNameSSLSocketPool;
629 629
630 template <typename ParentPool> 630 template <typename ParentPool>
631 CaptureGroupNameSocketPool<ParentPool>::CaptureGroupNameSocketPool( 631 CaptureGroupNameSocketPool<ParentPool>::CaptureGroupNameSocketPool(
632 HostResolver* host_resolver, 632 HostResolver* host_resolver,
633 CertVerifier* /* cert_verifier */) 633 CertVerifier* /* cert_verifier */)
634 : ParentPool(0, 0, host_resolver, NULL, NULL) { 634 : ParentPool(0, 0, host_resolver, NULL, NULL, NULL) {}
635 }
636 635
637 template <> 636 template <>
638 CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool( 637 CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool(
639 HostResolver* /* host_resolver */, 638 HostResolver* /* host_resolver */,
640 CertVerifier* /* cert_verifier */) 639 CertVerifier* /* cert_verifier */)
641 : HttpProxyClientSocketPool(0, 0, NULL, NULL, NULL) { 640 : HttpProxyClientSocketPool(0, 0, NULL, NULL, NULL) {
642 } 641 }
643 642
644 template <> 643 template <>
645 CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool( 644 CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool(
(...skipping 11014 matching lines...) Expand 10 before | Expand all | Expand 10 after
11660 11659
11661 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); 11660 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
11662 11661
11663 // Use a TCP Socket Pool with only one connection per group. This is used 11662 // Use a TCP Socket Pool with only one connection per group. This is used
11664 // to validate that the TCP socket is not released to the pool between 11663 // to validate that the TCP socket is not released to the pool between
11665 // each round of multi-round authentication. 11664 // each round of multi-round authentication.
11666 HttpNetworkSessionPeer session_peer(session.get()); 11665 HttpNetworkSessionPeer session_peer(session.get());
11667 TransportClientSocketPool* transport_pool = new TransportClientSocketPool( 11666 TransportClientSocketPool* transport_pool = new TransportClientSocketPool(
11668 50, // Max sockets for pool 11667 50, // Max sockets for pool
11669 1, // Max sockets per group 11668 1, // Max sockets per group
11670 session_deps_.host_resolver.get(), 11669 session_deps_.host_resolver.get(), session_deps_.socket_factory.get(),
11671 session_deps_.socket_factory.get(), 11670 NULL, session_deps_.net_log);
11672 session_deps_.net_log);
11673 scoped_ptr<MockClientSocketPoolManager> mock_pool_manager( 11671 scoped_ptr<MockClientSocketPoolManager> mock_pool_manager(
11674 new MockClientSocketPoolManager); 11672 new MockClientSocketPoolManager);
11675 mock_pool_manager->SetTransportSocketPool(transport_pool); 11673 mock_pool_manager->SetTransportSocketPool(transport_pool);
11676 session_peer.SetClientSocketPoolManager(std::move(mock_pool_manager)); 11674 session_peer.SetClientSocketPoolManager(std::move(mock_pool_manager));
11677 11675
11678 scoped_ptr<HttpTransaction> trans( 11676 scoped_ptr<HttpTransaction> trans(
11679 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); 11677 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
11680 TestCompletionCallback callback; 11678 TestCompletionCallback callback;
11681 11679
11682 const MockWrite kGet( 11680 const MockWrite kGet(
(...skipping 4267 matching lines...) Expand 10 before | Expand all | Expand 10 after
15950 base::MessageLoop::current()->RunUntilIdle(); 15948 base::MessageLoop::current()->RunUntilIdle();
15951 15949
15952 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); 15950 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy);
15953 HttpRequestHeaders headers; 15951 HttpRequestHeaders headers;
15954 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); 15952 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers));
15955 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); 15953 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding));
15956 } 15954 }
15957 #endif // !defined(OS_IOS) 15955 #endif // !defined(OS_IOS)
15958 15956
15959 } // namespace net 15957 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698