| 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_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "net/base/mock_cert_verifier.h" | 10 #include "net/base/mock_cert_verifier.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "net/spdy/spdy_session.h" | 25 #include "net/spdy/spdy_session.h" |
| 26 #include "net/spdy/spdy_session_pool.h" | 26 #include "net/spdy/spdy_session_pool.h" |
| 27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 class MockHttpStreamFactoryImpl : public HttpStreamFactoryImpl { | 33 class MockHttpStreamFactoryImpl : public HttpStreamFactoryImpl { |
| 34 public: | 34 public: |
| 35 MockHttpStreamFactoryImpl(HttpNetworkSession* session) | 35 explicit MockHttpStreamFactoryImpl(HttpNetworkSession* session) |
| 36 : HttpStreamFactoryImpl(session), | 36 : HttpStreamFactoryImpl(session), |
| 37 preconnect_done_(false), | 37 preconnect_done_(false), |
| 38 waiting_for_preconnect_(false) {} | 38 waiting_for_preconnect_(false) {} |
| 39 | 39 |
| 40 | 40 |
| 41 void WaitForPreconnects() { | 41 void WaitForPreconnects() { |
| 42 while (!preconnect_done_) { | 42 while (!preconnect_done_) { |
| 43 waiting_for_preconnect_ = true; | 43 waiting_for_preconnect_ = true; |
| 44 MessageLoop::current()->Run(); | 44 MessageLoop::current()->Run(); |
| 45 waiting_for_preconnect_ = false; | 45 waiting_for_preconnect_ = false; |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 const ProxyRetryInfoMap& retry_info = | 453 const ProxyRetryInfoMap& retry_info = |
| 454 session->proxy_service()->proxy_retry_info(); | 454 session->proxy_service()->proxy_retry_info(); |
| 455 EXPECT_EQ(1u, retry_info.size()); | 455 EXPECT_EQ(1u, retry_info.size()); |
| 456 ProxyRetryInfoMap::const_iterator iter = retry_info.find("bad:99"); | 456 ProxyRetryInfoMap::const_iterator iter = retry_info.find("bad:99"); |
| 457 EXPECT_TRUE(iter != retry_info.end()); | 457 EXPECT_TRUE(iter != retry_info.end()); |
| 458 } | 458 } |
| 459 | 459 |
| 460 } // namespace | 460 } // namespace |
| 461 | 461 |
| 462 } // namespace net | 462 } // namespace net |
| OLD | NEW |