| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } | 348 } |
| 349 | 349 |
| 350 const base::HistogramTester& histogram_tester() { return histogram_tester_; } | 350 const base::HistogramTester& histogram_tester() { return histogram_tester_; } |
| 351 | 351 |
| 352 // Returns a string for pattern-matching TaskManager tab entries. | 352 // Returns a string for pattern-matching TaskManager tab entries. |
| 353 base::string16 MatchTaskManagerTab(const char* page_title); | 353 base::string16 MatchTaskManagerTab(const char* page_title); |
| 354 | 354 |
| 355 // Returns a string for pattern-matching TaskManager prerender entries. | 355 // Returns a string for pattern-matching TaskManager prerender entries. |
| 356 base::string16 MatchTaskManagerPrerender(const char* page_title); | 356 base::string16 MatchTaskManagerPrerender(const char* page_title); |
| 357 | 357 |
| 358 // Returns a GURL for an EmbeddedTestServer that will serves the file |
| 359 // |url_file| with |replacement_text| replacing |replacement_variable|. |
| 360 GURL GetURLWithReplacement(const std::string& url_file, |
| 361 const std::string& replacement_variable, |
| 362 const std::string& replacement_text); |
| 363 |
| 358 protected: | 364 protected: |
| 359 // For each FinalStatus in |expected_final_status_queue| creates a prerender | 365 // For each FinalStatus in |expected_final_status_queue| creates a prerender |
| 360 // that is going to verify the correctness of its FinalStatus upon | 366 // that is going to verify the correctness of its FinalStatus upon |
| 361 // destruction. Waits for creation of the first PrerenderContents. | 367 // destruction. Waits for creation of the first PrerenderContents. |
| 362 std::vector<std::unique_ptr<TestPrerender>> NavigateWithPrerenders( | 368 std::vector<std::unique_ptr<TestPrerender>> NavigateWithPrerenders( |
| 363 const GURL& loader_url, | 369 const GURL& loader_url, |
| 364 const std::vector<FinalStatus>& expected_final_status_queue); | 370 const std::vector<FinalStatus>& expected_final_status_queue); |
| 365 | 371 |
| 366 // Creates the URL that instructs the test server to substitute the text | 372 // Creates the URL that instructs the test server to substitute the text |
| 367 // |replacement_variable| in the contents of the file pointed to by | 373 // |replacement_variable| in the contents of the file pointed to by |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 // |file| afterwards. When the first load has been scheduled, runs |callback| on | 436 // |file| afterwards. When the first load has been scheduled, runs |callback| on |
| 431 // the UI thread. | 437 // the UI thread. |
| 432 void CreateHangingFirstRequestInterceptorOnIO( | 438 void CreateHangingFirstRequestInterceptorOnIO( |
| 433 const GURL& url, const base::FilePath& file, base::Closure callback); | 439 const GURL& url, const base::FilePath& file, base::Closure callback); |
| 434 | 440 |
| 435 } // namespace test_utils | 441 } // namespace test_utils |
| 436 | 442 |
| 437 } // namespace prerender | 443 } // namespace prerender |
| 438 | 444 |
| 439 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ | 445 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ |
| OLD | NEW |