OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <deque> | 5 #include <deque> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 | 217 |
218 virtual bool AddAliasURL(const GURL& url) OVERRIDE { | 218 virtual bool AddAliasURL(const GURL& url) OVERRIDE { |
219 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in | 219 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in |
220 // the PrerenderRendererCrash test. | 220 // the PrerenderRendererCrash test. |
221 if (url.spec() != chrome::kChromeUICrashURL) | 221 if (url.spec() != chrome::kChromeUICrashURL) |
222 return PrerenderContents::AddAliasURL(url); | 222 return PrerenderContents::AddAliasURL(url); |
223 return true; | 223 return true; |
224 } | 224 } |
225 | 225 |
226 virtual void DidStopLoading() OVERRIDE { | 226 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE { |
227 PrerenderContents::DidStopLoading(); | 227 PrerenderContents::DidStopLoading(render_view_host); |
228 ++number_of_loads_; | 228 ++number_of_loads_; |
229 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && | 229 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && |
230 number_of_loads_ == expected_number_of_loads_) { | 230 number_of_loads_ == expected_number_of_loads_) { |
231 MessageLoopForUI::current()->Quit(); | 231 MessageLoopForUI::current()->Quit(); |
232 } | 232 } |
233 } | 233 } |
234 | 234 |
235 virtual void AddPendingPrerender( | 235 virtual void AddPendingPrerender( |
236 base::WeakPtr<PrerenderHandle> weak_prerender_handle, | 236 base::WeakPtr<PrerenderHandle> weak_prerender_handle, |
237 const GURL& url, | 237 const GURL& url, |
(...skipping 2145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 ResultCatcher catcher; | 2383 ResultCatcher catcher; |
2384 | 2384 |
2385 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); | 2385 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); |
2386 NavigateToDestURL(); | 2386 NavigateToDestURL(); |
2387 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); | 2387 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); |
2388 | 2388 |
2389 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 2389 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
2390 } | 2390 } |
2391 | 2391 |
2392 } // namespace prerender | 2392 } // namespace prerender |
OLD | NEW |