| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <functional> | 9 #include <functional> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // thread. Does not modify the behavior or the request job. | 420 // thread. Does not modify the behavior or the request job. |
| 421 void InterceptRequestAndCount( | 421 void InterceptRequestAndCount( |
| 422 const GURL& url, | 422 const GURL& url, |
| 423 RequestCounter* counter, | 423 RequestCounter* counter, |
| 424 base::Callback<void(net::URLRequest*)> callback_io); | 424 base::Callback<void(net::URLRequest*)> callback_io); |
| 425 | 425 |
| 426 // Makes |url| respond to requests with the contents of |file|. | 426 // Makes |url| respond to requests with the contents of |file|. |
| 427 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); | 427 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); |
| 428 | 428 |
| 429 // Makes |url| never respond on the first load, and then with the contents of | 429 // Makes |url| never respond on the first load, and then with the contents of |
| 430 // |file| afterwards. When the first load has been scheduled, runs |callback| on | 430 // |file| afterwards. When the first load has been scheduled, runs |callback_io| |
| 431 // the UI thread. | 431 // on the IO thread. |
| 432 void CreateHangingFirstRequestInterceptorOnIO( | 432 void CreateHangingFirstRequestInterceptor( |
| 433 const GURL& url, const base::FilePath& file, base::Closure callback); | 433 const GURL& url, |
| 434 const base::FilePath& file, |
| 435 base::Callback<void(net::URLRequest*)> callback_io); |
| 434 | 436 |
| 435 } // namespace test_utils | 437 } // namespace test_utils |
| 436 | 438 |
| 437 } // namespace prerender | 439 } // namespace prerender |
| 438 | 440 |
| 439 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ | 441 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ |
| OLD | NEW |