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

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: Addressed rsleevi 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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 CaptureGroupNameHttpProxySocketPool; 626 CaptureGroupNameHttpProxySocketPool;
627 typedef CaptureGroupNameSocketPool<SOCKSClientSocketPool> 627 typedef CaptureGroupNameSocketPool<SOCKSClientSocketPool>
628 CaptureGroupNameSOCKSSocketPool; 628 CaptureGroupNameSOCKSSocketPool;
629 typedef CaptureGroupNameSocketPool<SSLClientSocketPool> 629 typedef CaptureGroupNameSocketPool<SSLClientSocketPool>
630 CaptureGroupNameSSLSocketPool; 630 CaptureGroupNameSSLSocketPool;
631 631
632 template <typename ParentPool> 632 template <typename ParentPool>
633 CaptureGroupNameSocketPool<ParentPool>::CaptureGroupNameSocketPool( 633 CaptureGroupNameSocketPool<ParentPool>::CaptureGroupNameSocketPool(
634 HostResolver* host_resolver, 634 HostResolver* host_resolver,
635 CertVerifier* /* cert_verifier */) 635 CertVerifier* /* cert_verifier */)
636 : ParentPool(0, 0, host_resolver, NULL, NULL) { 636 : ParentPool(0, 0, host_resolver, NULL, NULL, NULL) {}
637 }
638 637
639 template <> 638 template <>
640 CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool( 639 CaptureGroupNameHttpProxySocketPool::CaptureGroupNameSocketPool(
641 HostResolver* /* host_resolver */, 640 HostResolver* /* host_resolver */,
642 CertVerifier* /* cert_verifier */) 641 CertVerifier* /* cert_verifier */)
643 : HttpProxyClientSocketPool(0, 0, NULL, NULL, NULL) { 642 : HttpProxyClientSocketPool(0, 0, NULL, NULL, NULL) {
644 } 643 }
645 644
646 template <> 645 template <>
647 CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool( 646 CaptureGroupNameSSLSocketPool::CaptureGroupNameSocketPool(
(...skipping 11016 matching lines...) Expand 10 before | Expand all | Expand 10 after
11664 11663
11665 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); 11664 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
11666 11665
11667 // Use a TCP Socket Pool with only one connection per group. This is used 11666 // Use a TCP Socket Pool with only one connection per group. This is used
11668 // to validate that the TCP socket is not released to the pool between 11667 // to validate that the TCP socket is not released to the pool between
11669 // each round of multi-round authentication. 11668 // each round of multi-round authentication.
11670 HttpNetworkSessionPeer session_peer(session.get()); 11669 HttpNetworkSessionPeer session_peer(session.get());
11671 TransportClientSocketPool* transport_pool = new TransportClientSocketPool( 11670 TransportClientSocketPool* transport_pool = new TransportClientSocketPool(
11672 50, // Max sockets for pool 11671 50, // Max sockets for pool
11673 1, // Max sockets per group 11672 1, // Max sockets per group
11674 session_deps_.host_resolver.get(), 11673 session_deps_.host_resolver.get(), session_deps_.socket_factory.get(),
11675 session_deps_.socket_factory.get(), 11674 NULL, session_deps_.net_log);
11676 session_deps_.net_log);
11677 scoped_ptr<MockClientSocketPoolManager> mock_pool_manager( 11675 scoped_ptr<MockClientSocketPoolManager> mock_pool_manager(
11678 new MockClientSocketPoolManager); 11676 new MockClientSocketPoolManager);
11679 mock_pool_manager->SetTransportSocketPool(transport_pool); 11677 mock_pool_manager->SetTransportSocketPool(transport_pool);
11680 session_peer.SetClientSocketPoolManager(std::move(mock_pool_manager)); 11678 session_peer.SetClientSocketPoolManager(std::move(mock_pool_manager));
11681 11679
11682 scoped_ptr<HttpTransaction> trans( 11680 scoped_ptr<HttpTransaction> trans(
11683 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); 11681 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
11684 TestCompletionCallback callback; 11682 TestCompletionCallback callback;
11685 11683
11686 const MockWrite kGet( 11684 const MockWrite kGet(
(...skipping 4273 matching lines...) Expand 10 before | Expand all | Expand 10 after
15960 base::MessageLoop::current()->RunUntilIdle(); 15958 base::MessageLoop::current()->RunUntilIdle();
15961 15959
15962 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); 15960 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy);
15963 HttpRequestHeaders headers; 15961 HttpRequestHeaders headers;
15964 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); 15962 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers));
15965 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); 15963 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding));
15966 } 15964 }
15967 #endif // !defined(OS_IOS) 15965 #endif // !defined(OS_IOS)
15968 15966
15969 } // namespace net 15967 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698