| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // Makes |url| respond to requests with the contents of |file|, counting the | 371 // Makes |url| respond to requests with the contents of |file|, counting the |
| 372 // number that start in |counter|. | 372 // number that start in |counter|. |
| 373 void CreateCountingInterceptorOnIO( | 373 void CreateCountingInterceptorOnIO( |
| 374 const GURL& url, | 374 const GURL& url, |
| 375 const base::FilePath& file, | 375 const base::FilePath& file, |
| 376 const base::WeakPtr<RequestCounter>& counter); | 376 const base::WeakPtr<RequestCounter>& counter); |
| 377 | 377 |
| 378 // Makes |url| respond to requests with the contents of |file|. | 378 // Makes |url| respond to requests with the contents of |file|. |
| 379 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); | 379 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); |
| 380 | 380 |
| 381 // Makes |url| never respond on the first load, and then with the contents of |
| 382 // |file| afterwards. When the first load has been scheduled, runs |callback| on |
| 383 // the UI thread. |
| 384 void CreateHangingFirstRequestInterceptorOnIO( |
| 385 const GURL& url, const base::FilePath& file, base::Closure callback); |
| 386 |
| 381 } // namespace test_utils | 387 } // namespace test_utils |
| 382 | 388 |
| 383 } // namespace prerender | 389 } // namespace prerender |
| 384 | 390 |
| 385 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ | 391 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ |
| OLD | NEW |