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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 // thread. Does not modify the behavior or the request job. | 426 // thread. Does not modify the behavior or the request job. |
427 void InterceptRequestAndCount( | 427 void InterceptRequestAndCount( |
428 const GURL& url, | 428 const GURL& url, |
429 RequestCounter* counter, | 429 RequestCounter* counter, |
430 base::Callback<void(net::URLRequest*)> callback_io); | 430 base::Callback<void(net::URLRequest*)> callback_io); |
431 | 431 |
432 // Makes |url| respond to requests with the contents of |file|. | 432 // Makes |url| respond to requests with the contents of |file|. |
433 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); | 433 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); |
434 | 434 |
435 // Makes |url| never respond on the first load, and then with the contents of | 435 // Makes |url| never respond on the first load, and then with the contents of |
436 // |file| afterwards. When the first load has been scheduled, runs |callback| on | 436 // |file| afterwards. When the first load has been scheduled, runs |callback_io| |
437 // the UI thread. | 437 // on the IO thread. |
438 void CreateHangingFirstRequestInterceptorOnIO( | 438 void CreateHangingFirstRequestInterceptor( |
439 const GURL& url, const base::FilePath& file, base::Closure callback); | 439 const GURL& url, |
| 440 const base::FilePath& file, |
| 441 base::Callback<void(net::URLRequest*)> callback_io); |
440 | 442 |
441 } // namespace test_utils | 443 } // namespace test_utils |
442 | 444 |
443 } // namespace prerender | 445 } // namespace prerender |
444 | 446 |
445 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ | 447 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ |
OLD | NEW |