OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/loader/async_revalidation_driver.h" | 5 #include "content/browser/loader/async_revalidation_driver.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <type_traits> | 8 #include <type_traits> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 | 195 |
196 // Verifies that resuming a deferred request works. Assumes that DeferOnStart | 196 // Verifies that resuming a deferred request works. Assumes that DeferOnStart |
197 // passes. | 197 // passes. |
198 TEST_F(AsyncRevalidationDriverTest, ResumeDeferredRequestWorks) { | 198 TEST_F(AsyncRevalidationDriverTest, ResumeDeferredRequestWorks) { |
199 raw_ptr_resource_throttle_->set_defer_request_on_will_start_request(true); | 199 raw_ptr_resource_throttle_->set_defer_request_on_will_start_request(true); |
200 | 200 |
201 driver_->StartRequest(); | 201 driver_->StartRequest(); |
202 base::RunLoop().RunUntilIdle(); | 202 base::RunLoop().RunUntilIdle(); |
203 | 203 |
204 ResourceController* driver_as_resource_controller = driver_.get(); | 204 ResourceThrottle::Delegate* driver_as_resource_throttle_delegate = |
205 driver_as_resource_controller->Resume(); | 205 driver_.get(); |
| 206 driver_as_resource_throttle_delegate->Resume(); |
206 base::RunLoop().RunUntilIdle(); | 207 base::RunLoop().RunUntilIdle(); |
207 EXPECT_TRUE(async_revalidation_complete_called()); | 208 EXPECT_TRUE(async_revalidation_complete_called()); |
208 } | 209 } |
209 | 210 |
210 // Verifies that redirects are not followed. | 211 // Verifies that redirects are not followed. |
211 TEST_F(AsyncRevalidationDriverTest, RedirectsAreNotFollowed) { | 212 TEST_F(AsyncRevalidationDriverTest, RedirectsAreNotFollowed) { |
212 SetUpAsyncRevalidationDriverWithRequestToUrl( | 213 SetUpAsyncRevalidationDriverWithRequestToUrl( |
213 net::URLRequestTestJob::test_url_redirect_to_url_2()); | 214 net::URLRequestTestJob::test_url_redirect_to_url_2()); |
214 | 215 |
215 driver_->StartRequest(); | 216 driver_->StartRequest(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 TEST_F(AsyncRevalidationDriverFromCacheTest, | 393 TEST_F(AsyncRevalidationDriverFromCacheTest, |
393 CacheNotReadOnSuccessfulRevalidation) { | 394 CacheNotReadOnSuccessfulRevalidation) { |
394 driver_->StartRequest(); | 395 driver_->StartRequest(); |
395 base::RunLoop().RunUntilIdle(); | 396 base::RunLoop().RunUntilIdle(); |
396 | 397 |
397 EXPECT_TRUE(async_revalidation_complete_called()); | 398 EXPECT_TRUE(async_revalidation_complete_called()); |
398 } | 399 } |
399 | 400 |
400 } // namespace | 401 } // namespace |
401 } // namespace content | 402 } // namespace content |
OLD | NEW |