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

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

Issue 7017014: Fix issues when PrerenderContents::Destroy() is called during TabContents destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unnecessary function call Created 9 years, 7 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
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/memory/scoped_temp_dir.h" 8 #include "base/memory/scoped_temp_dir.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 new_render_view_host_(NULL), 70 new_render_view_host_(NULL),
71 was_hidden_(false), 71 was_hidden_(false),
72 was_shown_(false) { 72 was_shown_(false) {
73 } 73 }
74 74
75 virtual ~TestPrerenderContents() { 75 virtual ~TestPrerenderContents() {
76 EXPECT_EQ(expected_final_status_, final_status()) << 76 EXPECT_EQ(expected_final_status_, final_status()) <<
77 " when testing URL " << prerender_url().path(); 77 " when testing URL " << prerender_url().path();
78 // Prerendering RenderViewHosts should be hidden before the first 78 // Prerendering RenderViewHosts should be hidden before the first
79 // navigation, so this should be happen for every PrerenderContents for 79 // navigation, so this should be happen for every PrerenderContents for
80 // while a RenderViewHost is created, regardless of whether or not it's 80 // which a RenderViewHost is created, regardless of whether or not it's
81 // used. 81 // used.
82 if (new_render_view_host_) { 82 if (new_render_view_host_) {
83 EXPECT_TRUE(was_hidden_); 83 EXPECT_TRUE(was_hidden_);
84 } 84 }
85 85
86 // A used PrerenderContents will only be destroyed when we swap out 86 // A used PrerenderContents will only be destroyed when we swap out
87 // TabContents, at the end of a navigation caused by a call to 87 // TabContents, at the end of a navigation caused by a call to
88 // NavigateToURLImpl(). 88 // NavigateToURLImpl().
89 if (final_status() == FINAL_STATUS_USED) { 89 if (final_status() == FINAL_STATUS_USED) {
90 EXPECT_TRUE(new_render_view_host_); 90 EXPECT_TRUE(new_render_view_host_);
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderIframeDelayLoadPlugin) { 473 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderIframeDelayLoadPlugin) {
474 PrerenderTestURL("files/prerender/prerender_iframe_plugin_delay_load.html", 474 PrerenderTestURL("files/prerender/prerender_iframe_plugin_delay_load.html",
475 FINAL_STATUS_USED, 475 FINAL_STATUS_USED,
476 1); 476 1);
477 NavigateToDestURL(); 477 NavigateToDestURL();
478 } 478 }
479 479
480 // Renders a page that contains a prerender link to a page that contains an 480 // Renders a page that contains a prerender link to a page that contains an
481 // iframe with a source that requires http authentication. This should not 481 // iframe with a source that requires http authentication. This should not
482 // prerender successfully. 482 // prerender successfully.
483 // Flaky, and crbug.com was down when discovered, so no crbug entry. 483 // Flaky: http://crbug.com/82913.
484 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 484 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
485 DISABLED_PrerenderHttpAuthentication) { 485 FLAKY_PrerenderHttpAuthentication) {
486 PrerenderTestURL("files/prerender/prerender_http_auth_container.html", 486 PrerenderTestURL("files/prerender/prerender_http_auth_container.html",
487 FINAL_STATUS_AUTH_NEEDED, 487 FINAL_STATUS_AUTH_NEEDED,
488 1); 488 1);
489 } 489 }
490 490
491 // Checks that client-issued redirects work with prerendering. 491 // Checks that client-issued redirects work with prerendering.
492 // This version navigates to the page which issues the redirection, rather 492 // This version navigates to the page which issues the redirection, rather
493 // than the final destination page. 493 // than the final destination page.
494 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 494 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
495 PrerenderClientRedirectNavigateToFirst) { 495 PrerenderClientRedirectNavigateToFirst) {
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 std::string replacement_path; 1068 std::string replacement_path;
1069 ASSERT_TRUE(net::TestServer::GetFilePathWithReplacements( 1069 ASSERT_TRUE(net::TestServer::GetFilePathWithReplacements(
1070 "files/prerender/prerender_with_iframe.html", 1070 "files/prerender/prerender_with_iframe.html",
1071 replacement_text, 1071 replacement_text,
1072 &replacement_path)); 1072 &replacement_path));
1073 PrerenderTestURL(replacement_path, FINAL_STATUS_USED, 1); 1073 PrerenderTestURL(replacement_path, FINAL_STATUS_USED, 1);
1074 NavigateToDestURL(); 1074 NavigateToDestURL();
1075 } 1075 }
1076 1076
1077 } // namespace prerender 1077 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.cc » ('j') | chrome/browser/prerender/prerender_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698