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 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 final_status() != expected_final_status_) { | 282 final_status() != expected_final_status_) { |
283 expected_final_status_ = FINAL_STATUS_RENDERER_CRASHED; | 283 expected_final_status_ = FINAL_STATUS_RENDERER_CRASHED; |
284 } | 284 } |
285 | 285 |
286 PrerenderContents::RenderViewGone(status); | 286 PrerenderContents::RenderViewGone(status); |
287 } | 287 } |
288 | 288 |
289 virtual bool AddAliasURL(const GURL& url) OVERRIDE { | 289 virtual bool AddAliasURL(const GURL& url) OVERRIDE { |
290 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in | 290 // Prevent FINAL_STATUS_UNSUPPORTED_SCHEME when navigating to about:crash in |
291 // the PrerenderRendererCrash test. | 291 // the PrerenderRendererCrash test. |
292 if (url.spec() != chrome::kChromeUICrashURL) | 292 if (url.spec() != content::kChromeUICrashURL) |
293 return PrerenderContents::AddAliasURL(url); | 293 return PrerenderContents::AddAliasURL(url); |
294 return true; | 294 return true; |
295 } | 295 } |
296 | 296 |
297 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE { | 297 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE { |
298 PrerenderContents::DidStopLoading(render_view_host); | 298 PrerenderContents::DidStopLoading(render_view_host); |
299 ++number_of_loads_; | 299 ++number_of_loads_; |
300 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && | 300 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && |
301 number_of_loads_ == expected_number_of_loads_) { | 301 number_of_loads_ == expected_number_of_loads_) { |
302 MessageLoopForUI::current()->Quit(); | 302 MessageLoopForUI::current()->Quit(); |
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MAYBE_PrerenderRendererCrash) { | 1958 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, MAYBE_PrerenderRendererCrash) { |
1959 PrerenderTestURL("files/prerender/prerender_page.html", | 1959 PrerenderTestURL("files/prerender/prerender_page.html", |
1960 FINAL_STATUS_RENDERER_CRASHED, | 1960 FINAL_STATUS_RENDERER_CRASHED, |
1961 1); | 1961 1); |
1962 | 1962 |
1963 // Navigate to about:crash and then wait for the renderer to crash. | 1963 // Navigate to about:crash and then wait for the renderer to crash. |
1964 ASSERT_TRUE(GetPrerenderContents()); | 1964 ASSERT_TRUE(GetPrerenderContents()); |
1965 ASSERT_TRUE(GetPrerenderContents()->prerender_contents()); | 1965 ASSERT_TRUE(GetPrerenderContents()->prerender_contents()); |
1966 GetPrerenderContents()->prerender_contents()->GetController(). | 1966 GetPrerenderContents()->prerender_contents()->GetController(). |
1967 LoadURL( | 1967 LoadURL( |
1968 GURL(chrome::kChromeUICrashURL), | 1968 GURL(content::kChromeUICrashURL), |
1969 content::Referrer(), | 1969 content::Referrer(), |
1970 content::PAGE_TRANSITION_TYPED, | 1970 content::PAGE_TRANSITION_TYPED, |
1971 std::string()); | 1971 std::string()); |
1972 content::RunMessageLoop(); | 1972 content::RunMessageLoop(); |
1973 } | 1973 } |
1974 | 1974 |
1975 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, | 1975 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, |
1976 PrerenderPageWithFragment) { | 1976 PrerenderPageWithFragment) { |
1977 PrerenderTestURL("files/prerender/prerender_page.html#fragment", | 1977 PrerenderTestURL("files/prerender/prerender_page.html#fragment", |
1978 FINAL_STATUS_USED, | 1978 FINAL_STATUS_USED, |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2739 channel_close_watcher.WatchChannel(browser()->tab_strip_model()-> | 2739 channel_close_watcher.WatchChannel(browser()->tab_strip_model()-> |
2740 GetActiveWebContents()->GetRenderProcessHost()); | 2740 GetActiveWebContents()->GetRenderProcessHost()); |
2741 NavigateToDestURL(); | 2741 NavigateToDestURL(); |
2742 channel_close_watcher.WaitForChannelClose(); | 2742 channel_close_watcher.WaitForChannelClose(); |
2743 | 2743 |
2744 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); | 2744 ASSERT_TRUE(IsEmptyPrerenderLinkManager()); |
2745 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 2745 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
2746 } | 2746 } |
2747 | 2747 |
2748 } // namespace prerender | 2748 } // namespace prerender |
OLD | NEW |