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

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

Issue 2365243004: QUIC/1+SPYD/3 => QUIC (Closed)
Patch Set: Rebase. Created 4 years, 2 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 (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_stream_factory_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 bidi_request_info.priority = LOWEST; 1899 bidi_request_info.priority = LOWEST;
1900 1900
1901 TestBidirectionalDelegate delegate; 1901 TestBidirectionalDelegate delegate;
1902 stream_impl->Start(&bidi_request_info, NetLogWithSource(), 1902 stream_impl->Start(&bidi_request_info, NetLogWithSource(),
1903 /*send_request_headers_automatically=*/true, &delegate, 1903 /*send_request_headers_automatically=*/true, &delegate,
1904 nullptr); 1904 nullptr);
1905 delegate.WaitUntilDone(); 1905 delegate.WaitUntilDone();
1906 1906
1907 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1); 1907 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1);
1908 EXPECT_THAT(stream_impl->ReadData(buffer.get(), 1), IsOk()); 1908 EXPECT_THAT(stream_impl->ReadData(buffer.get(), 1), IsOk());
1909 EXPECT_EQ(kProtoQUIC1SPDY3, stream_impl->GetProtocol()); 1909 EXPECT_EQ(kProtoQUIC, stream_impl->GetProtocol());
1910 EXPECT_EQ("200", delegate.response_headers().find(":status")->second); 1910 EXPECT_EQ("200", delegate.response_headers().find(":status")->second);
1911 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( 1911 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool(
1912 HttpNetworkSession::NORMAL_SOCKET_POOL))); 1912 HttpNetworkSession::NORMAL_SOCKET_POOL)));
1913 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( 1913 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool(
1914 HttpNetworkSession::NORMAL_SOCKET_POOL))); 1914 HttpNetworkSession::NORMAL_SOCKET_POOL)));
1915 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( 1915 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool(
1916 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 1916 HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
1917 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( 1917 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool(
1918 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 1918 HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
1919 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); 1919 EXPECT_TRUE(waiter.used_proxy_info().is_direct());
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 2023
2024 TestBidirectionalDelegate delegate; 2024 TestBidirectionalDelegate delegate;
2025 stream_impl->Start(&bidi_request_info, NetLogWithSource(), 2025 stream_impl->Start(&bidi_request_info, NetLogWithSource(),
2026 /*send_request_headers_automatically=*/true, &delegate, 2026 /*send_request_headers_automatically=*/true, &delegate,
2027 nullptr); 2027 nullptr);
2028 delegate.WaitUntilDone(); 2028 delegate.WaitUntilDone();
2029 2029
2030 // Make sure the BidirectionalStream negotiated goes through QUIC. 2030 // Make sure the BidirectionalStream negotiated goes through QUIC.
2031 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1); 2031 scoped_refptr<IOBuffer> buffer = new net::IOBuffer(1);
2032 EXPECT_THAT(stream_impl->ReadData(buffer.get(), 1), IsOk()); 2032 EXPECT_THAT(stream_impl->ReadData(buffer.get(), 1), IsOk());
2033 EXPECT_EQ(kProtoQUIC1SPDY3, stream_impl->GetProtocol()); 2033 EXPECT_EQ(kProtoQUIC, stream_impl->GetProtocol());
2034 EXPECT_EQ("200", delegate.response_headers().find(":status")->second); 2034 EXPECT_EQ("200", delegate.response_headers().find(":status")->second);
2035 // There is no Http2 socket pool. 2035 // There is no Http2 socket pool.
2036 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( 2036 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool(
2037 HttpNetworkSession::NORMAL_SOCKET_POOL))); 2037 HttpNetworkSession::NORMAL_SOCKET_POOL)));
2038 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( 2038 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool(
2039 HttpNetworkSession::NORMAL_SOCKET_POOL))); 2039 HttpNetworkSession::NORMAL_SOCKET_POOL)));
2040 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool( 2040 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetTransportSocketPool(
2041 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 2041 HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
2042 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool( 2042 EXPECT_EQ(0, GetSocketPoolGroupCount(session()->GetSSLSocketPool(
2043 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 2043 HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 session->GetTransportSocketPool( 2265 session->GetTransportSocketPool(
2266 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 2266 HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
2267 EXPECT_EQ(1, GetSocketPoolGroupCount( 2267 EXPECT_EQ(1, GetSocketPoolGroupCount(
2268 session->GetSSLSocketPool(HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 2268 session->GetSSLSocketPool(HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
2269 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); 2269 EXPECT_TRUE(waiter.used_proxy_info().is_direct());
2270 } 2270 }
2271 2271
2272 } // namespace 2272 } // namespace
2273 2273
2274 } // namespace net 2274 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698