| 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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 render_view_host->ExecuteJavascriptInWebFrame( | 1147 render_view_host->ExecuteJavascriptInWebFrame( |
| 1148 string16(), ASCIIToUTF16(javascript_function_name)); | 1148 string16(), ASCIIToUTF16(javascript_function_name)); |
| 1149 | 1149 |
| 1150 if (prerender_contents->quit_message_loop_on_destruction()) { | 1150 if (prerender_contents->quit_message_loop_on_destruction()) { |
| 1151 // Run message loop until the prerender contents is destroyed. | 1151 // Run message loop until the prerender contents is destroyed. |
| 1152 content::RunMessageLoop(); | 1152 content::RunMessageLoop(); |
| 1153 } else { | 1153 } else { |
| 1154 // We don't expect to pick up a running prerender, so instead | 1154 // We don't expect to pick up a running prerender, so instead |
| 1155 // observe one navigation. | 1155 // observe one navigation. |
| 1156 content::TestNavigationObserver observer( | 1156 content::TestNavigationObserver observer( |
| 1157 content::NotificationService::AllSources(), NULL, 1); | 1157 content::NotificationService::AllSources(), 1); |
| 1158 base::RunLoop run_loop; | 1158 base::RunLoop run_loop; |
| 1159 observer.WaitForObservation( | 1159 observer.WaitForObservation( |
| 1160 base::Bind(&content::RunThisRunLoop, | 1160 base::Bind(&content::RunThisRunLoop, |
| 1161 base::Unretained(&run_loop)), | 1161 base::Unretained(&run_loop)), |
| 1162 content::GetQuitTaskForRunLoop(&run_loop)); | 1162 content::GetQuitTaskForRunLoop(&run_loop)); |
| 1163 } | 1163 } |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 WaitForLoadPrerenderContentsFactory* prerender_contents_factory_; | 1166 WaitForLoadPrerenderContentsFactory* prerender_contents_factory_; |
| 1167 #if defined(FULL_SAFE_BROWSING) | 1167 #if defined(FULL_SAFE_BROWSING) |
| (...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2781 // Checks that non-http/https main page redirects cancel the prerender. | 2781 // Checks that non-http/https main page redirects cancel the prerender. |
| 2782 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, | 2782 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, |
| 2783 PrerenderCancelMainFrameRedirectUnsupportedScheme) { | 2783 PrerenderCancelMainFrameRedirectUnsupportedScheme) { |
| 2784 GURL url = test_server()->GetURL( | 2784 GURL url = test_server()->GetURL( |
| 2785 CreateServerRedirect("invalidscheme://www.google.com/test.html")); | 2785 CreateServerRedirect("invalidscheme://www.google.com/test.html")); |
| 2786 PrerenderTestURL(url, FINAL_STATUS_UNSUPPORTED_SCHEME, 1); | 2786 PrerenderTestURL(url, FINAL_STATUS_UNSUPPORTED_SCHEME, 1); |
| 2787 NavigateToDestURL(); | 2787 NavigateToDestURL(); |
| 2788 } | 2788 } |
| 2789 | 2789 |
| 2790 } // namespace prerender | 2790 } // namespace prerender |
| OLD | NEW |