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 <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 public: | 98 public: |
99 TestPrerenderContents(PrerenderManager* prerender_manager, | 99 TestPrerenderContents(PrerenderManager* prerender_manager, |
100 Profile* profile, | 100 Profile* profile, |
101 const GURL& url, | 101 const GURL& url, |
102 const content::Referrer& referrer, | 102 const content::Referrer& referrer, |
103 Origin origin, | 103 Origin origin, |
104 FinalStatus expected_final_status); | 104 FinalStatus expected_final_status); |
105 | 105 |
106 ~TestPrerenderContents() override; | 106 ~TestPrerenderContents() override; |
107 | 107 |
108 void RenderProcessGone(base::TerminationStatus status) override; | |
109 bool CheckURL(const GURL& url) override; | 108 bool CheckURL(const GURL& url) override; |
110 | 109 |
111 // For tests that open the prerender in a new background tab, the RenderView | 110 // For tests that open the prerender in a new background tab, the RenderView |
112 // will not have been made visible when the PrerenderContents is destroyed | 111 // will not have been made visible when the PrerenderContents is destroyed |
113 // even though it is used. | 112 // even though it is used. |
114 void set_should_be_shown(bool value) { should_be_shown_ = value; } | 113 void set_should_be_shown(bool value) { should_be_shown_ = value; } |
115 | 114 |
116 // For tests which do not know whether the prerender will be used. | 115 // For tests which do not know whether the prerender will be used. |
117 void set_skip_final_checks(bool value) { skip_final_checks_ = value; } | 116 void set_skip_final_checks(bool value) { skip_final_checks_ = value; } |
118 | 117 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 const base::WeakPtr<RequestCounter>& counter); | 373 const base::WeakPtr<RequestCounter>& counter); |
375 | 374 |
376 // Makes |url| respond to requests with the contents of |file|. | 375 // Makes |url| respond to requests with the contents of |file|. |
377 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); | 376 void CreateMockInterceptorOnIO(const GURL& url, const base::FilePath& file); |
378 | 377 |
379 } // namespace test_utils | 378 } // namespace test_utils |
380 | 379 |
381 } // namespace prerender | 380 } // namespace prerender |
382 | 381 |
383 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ | 382 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TEST_UTILS_H_ |
OLD | NEW |