Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 8253002: Move PageTransition into content namespace. While I'm touching all these files, I've also updated... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/plugin_observer.cc ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 new WaitForLoadPrerenderContentsFactory(expected_number_of_loads, 670 new WaitForLoadPrerenderContentsFactory(expected_number_of_loads,
671 expected_final_status_queue); 671 expected_final_status_queue);
672 prerender_manager()->SetPrerenderContentsFactory( 672 prerender_manager()->SetPrerenderContentsFactory(
673 prerender_contents_factory_); 673 prerender_contents_factory_);
674 FinalStatus expected_final_status = expected_final_status_queue.front(); 674 FinalStatus expected_final_status = expected_final_status_queue.front();
675 675
676 // ui_test_utils::NavigateToURL uses its own observer and message loop. 676 // ui_test_utils::NavigateToURL uses its own observer and message loop.
677 // Since the test needs to wait until the prerendered page has stopped 677 // Since the test needs to wait until the prerendered page has stopped
678 // loading, rather than the page directly navigated to, need to 678 // loading, rather than the page directly navigated to, need to
679 // handle browser navigation directly. 679 // handle browser navigation directly.
680 browser()->OpenURL(src_url, GURL(), CURRENT_TAB, PageTransition::TYPED); 680 browser()->OpenURL(
681 src_url, GURL(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED);
681 682
682 ui_test_utils::RunMessageLoop(); 683 ui_test_utils::RunMessageLoop();
683 684
684 TestPrerenderContents* prerender_contents = GetPrerenderContents(); 685 TestPrerenderContents* prerender_contents = GetPrerenderContents();
685 686
686 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status)) { 687 if (ShouldRenderPrerenderedPageCorrectly(expected_final_status)) {
687 ASSERT_TRUE(prerender_contents != NULL); 688 ASSERT_TRUE(prerender_contents != NULL);
688 EXPECT_EQ(FINAL_STATUS_MAX, prerender_contents->final_status()); 689 EXPECT_EQ(FINAL_STATUS_MAX, prerender_contents->final_status());
689 690
690 if (call_javascript_ && expected_number_of_loads > 0) { 691 if (call_javascript_ && expected_number_of_loads > 0) {
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 // Checks that prerenderers will terminate when the RenderView crashes. 1291 // Checks that prerenderers will terminate when the RenderView crashes.
1291 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderRendererCrash) { 1292 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderRendererCrash) {
1292 PrerenderTestURL("files/prerender/prerender_page.html", 1293 PrerenderTestURL("files/prerender/prerender_page.html",
1293 FINAL_STATUS_RENDERER_CRASHED, 1294 FINAL_STATUS_RENDERER_CRASHED,
1294 1); 1295 1);
1295 1296
1296 // Navigate to about:crash and then wait for the renderer to crash. 1297 // Navigate to about:crash and then wait for the renderer to crash.
1297 ASSERT_TRUE(GetPrerenderContents()); 1298 ASSERT_TRUE(GetPrerenderContents());
1298 ASSERT_TRUE(GetPrerenderContents()->prerender_contents()); 1299 ASSERT_TRUE(GetPrerenderContents()->prerender_contents());
1299 GetPrerenderContents()->prerender_contents()->controller().LoadURL( 1300 GetPrerenderContents()->prerender_contents()->controller().LoadURL(
1300 GURL(chrome::kAboutCrashURL), GURL(), PageTransition::TYPED, 1301 GURL(chrome::kAboutCrashURL), GURL(), content::PAGE_TRANSITION_TYPED,
1301 std::string()); 1302 std::string());
1302 ui_test_utils::RunMessageLoop(); 1303 ui_test_utils::RunMessageLoop();
1303 } 1304 }
1304 1305
1305 // Checks that we correctly use a prerendered page when navigating to a 1306 // Checks that we correctly use a prerendered page when navigating to a
1306 // fragment. 1307 // fragment.
1307 // DISABLED: http://crbug.com/84154 1308 // DISABLED: http://crbug.com/84154
1308 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 1309 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
1309 DISABLED_PrerenderPageNavigateFragment) { 1310 DISABLED_PrerenderPageNavigateFragment) {
1310 PrerenderTestURL("files/prerender/prerender_fragment.html", 1311 PrerenderTestURL("files/prerender/prerender_fragment.html",
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 RenderViewHost* inspected_rvh = tab_contents->render_view_host(); 1898 RenderViewHost* inspected_rvh = tab_contents->render_view_host();
1898 DevToolsManager* manager = DevToolsManager::GetInstance(); 1899 DevToolsManager* manager = DevToolsManager::GetInstance();
1899 FakeDevToolsClientHost client_host; 1900 FakeDevToolsClientHost client_host;
1900 manager->RegisterDevToolsClientHostFor(inspected_rvh, &client_host); 1901 manager->RegisterDevToolsClientHostFor(inspected_rvh, &client_host);
1901 const char* url = "files/prerender/prerender_page.html"; 1902 const char* url = "files/prerender/prerender_page.html";
1902 PrerenderTestURL(url, FINAL_STATUS_DEVTOOLS_ATTACHED, 1); 1903 PrerenderTestURL(url, FINAL_STATUS_DEVTOOLS_ATTACHED, 1);
1903 NavigateToURL(url); 1904 NavigateToURL(url);
1904 } 1905 }
1905 1906
1906 } // namespace prerender 1907 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/plugin_observer.cc ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698