| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_stream_factory_impl_request.h" | 5 #include "net/http/http_stream_factory_impl_request.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/run_loop.h" |
| 9 #include "net/http/http_stream_factory_impl_job.h" | 10 #include "net/http/http_stream_factory_impl_job.h" |
| 10 #include "net/proxy/proxy_info.h" | 11 #include "net/proxy/proxy_info.h" |
| 11 #include "net/proxy/proxy_service.h" | 12 #include "net/proxy/proxy_service.h" |
| 12 #include "net/spdy/spdy_test_util_common.h" | 13 #include "net/spdy/spdy_test_util_common.h" |
| 13 #include "net/ssl/ssl_failure_state.h" | 14 #include "net/ssl/ssl_failure_state.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 16 |
| 16 namespace net { | 17 namespace net { |
| 17 | 18 |
| 18 class HttpStreamFactoryImplRequestTest | 19 class HttpStreamFactoryImplRequestTest |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 job->Resume(alternative_job, delay); | 150 job->Resume(alternative_job, delay); |
| 150 | 151 |
| 151 // Verify |job| has |wait_time_| and there is no |blocking_job_| | 152 // Verify |job| has |wait_time_| and there is no |blocking_job_| |
| 152 EXPECT_EQ(delay, job->wait_time_); | 153 EXPECT_EQ(delay, job->wait_time_); |
| 153 EXPECT_TRUE(!job->blocking_job_); | 154 EXPECT_TRUE(!job->blocking_job_); |
| 154 | 155 |
| 155 // Start the |job| and verify |job|'s |wait_time_| is cleared. | 156 // Start the |job| and verify |job|'s |wait_time_| is cleared. |
| 156 job->Start(&request); | 157 job->Start(&request); |
| 157 | 158 |
| 158 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(wait_time + 1)); | 159 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(wait_time + 1)); |
| 159 base::MessageLoop::current()->RunUntilIdle(); | 160 base::RunLoop().RunUntilIdle(); |
| 160 | 161 |
| 161 EXPECT_NE(delay, job->wait_time_); | 162 EXPECT_NE(delay, job->wait_time_); |
| 162 EXPECT_TRUE(job->wait_time_.is_zero()); | 163 EXPECT_TRUE(job->wait_time_.is_zero()); |
| 163 EXPECT_EQ(HttpStreamFactoryImpl::Job::STATE_INIT_CONNECTION_COMPLETE, | 164 EXPECT_EQ(HttpStreamFactoryImpl::Job::STATE_INIT_CONNECTION_COMPLETE, |
| 164 job->next_state_); | 165 job->next_state_); |
| 165 } | 166 } |
| 166 | 167 |
| 167 } // namespace net | 168 } // namespace net |
| OLD | NEW |