Chromium Code Reviews| Index: net/http/http_stream_factory_impl_unittest.cc |
| diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc |
| index a33649090be28b3467eada923cb91343779cb0e5..a14335269cbe3992eef2b38a7229e9f365f69838 100644 |
| --- a/net/http/http_stream_factory_impl_unittest.cc |
| +++ b/net/http/http_stream_factory_impl_unittest.cc |
| @@ -1514,6 +1514,40 @@ TEST_F(HttpStreamFactoryTest, RequestHttpStream) { |
| EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
| } |
| +// Test the race of SetPriority versus stream completion where SetPriority |
| +// may be called on a stream request after the stream has been returned. |
|
mmenke
2017/01/06 20:48:54
Is this really needed by the API? Should be possi
Randy Smith (Not in Mondays)
2017/01/13 23:05:44
As phrased, not, but I wanted to do a crash test a
|
| +TEST_F(HttpStreamFactoryTest, ReprioritizeAfterStreamReceived) { |
| + SpdySessionDependencies session_deps(ProxyService::CreateDirect()); |
| + |
| + StaticSocketDataProvider socket_data; |
| + socket_data.set_connect_data(MockConnect(ASYNC, OK)); |
| + session_deps.socket_factory->AddSocketDataProvider(&socket_data); |
| + |
| + std::unique_ptr<HttpNetworkSession> session( |
| + SpdySessionDependencies::SpdyCreateSession(&session_deps)); |
| + |
| + // Now request a stream. It should succeed using the second proxy in the |
| + // list. |
| + HttpRequestInfo request_info; |
| + request_info.method = "GET"; |
| + request_info.url = GURL("http://www.google.com"); |
| + request_info.load_flags = 0; |
| + |
| + SSLConfig ssl_config; |
| + StreamRequestWaiter waiter; |
| + std::unique_ptr<HttpStreamRequest> request( |
| + session->http_stream_factory()->RequestStream( |
| + request_info, DEFAULT_PRIORITY, ssl_config, ssl_config, &waiter, |
| + NetLogWithSource())); |
| + waiter.WaitForStream(); |
| + EXPECT_TRUE(waiter.stream_done()); |
| + ASSERT_TRUE(nullptr != waiter.stream()); |
| + EXPECT_TRUE(nullptr == waiter.websocket_stream()); |
| + |
| + // Crash test |
|
mmenke
2017/01/06 20:48:54
Should not crash test?
Randy Smith (Not in Mondays)
2017/01/13 23:05:44
Done (in the new test).
|
| + request->SetPriority(HIGHEST); |
| +} |
| + |
| TEST_F(HttpStreamFactoryTest, RequestHttpStreamOverSSL) { |
| SpdySessionDependencies session_deps(ProxyService::CreateDirect()); |