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

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: Sync 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/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/content_settings/host_content_settings_map.h" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 new_render_view_host_(NULL), 82 new_render_view_host_(NULL),
83 was_hidden_(false), 83 was_hidden_(false),
84 was_shown_(false) { 84 was_shown_(false) {
85 } 85 }
86 86
87 virtual ~TestPrerenderContents() { 87 virtual ~TestPrerenderContents() {
88 EXPECT_EQ(expected_final_status_, final_status()) << 88 EXPECT_EQ(expected_final_status_, final_status()) <<
89 " when testing URL " << prerender_url().path(); 89 " when testing URL " << prerender_url().path();
90 // Prerendering RenderViewHosts should be hidden before the first 90 // Prerendering RenderViewHosts should be hidden before the first
91 // navigation, so this should be happen for every PrerenderContents for 91 // navigation, so this should be happen for every PrerenderContents for
92 // while a RenderViewHost is created, regardless of whether or not it's 92 // which a RenderViewHost is created, regardless of whether or not it's
93 // used. 93 // used.
94 if (new_render_view_host_) { 94 if (new_render_view_host_) {
95 EXPECT_TRUE(was_hidden_); 95 EXPECT_TRUE(was_hidden_);
96 } 96 }
97 97
98 // A used PrerenderContents will only be destroyed when we swap out 98 // A used PrerenderContents will only be destroyed when we swap out
99 // TabContents, at the end of a navigation caused by a call to 99 // TabContents, at the end of a navigation caused by a call to
100 // NavigateToURLImpl(). 100 // NavigateToURLImpl().
101 if (final_status() == FINAL_STATUS_USED) { 101 if (final_status() == FINAL_STATUS_USED) {
102 EXPECT_TRUE(new_render_view_host_); 102 EXPECT_TRUE(new_render_view_host_);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderIframeDelayLoadPlugin) { 512 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderIframeDelayLoadPlugin) {
513 PrerenderTestURL("files/prerender/prerender_iframe_plugin_delay_load.html", 513 PrerenderTestURL("files/prerender/prerender_iframe_plugin_delay_load.html",
514 FINAL_STATUS_USED, 514 FINAL_STATUS_USED,
515 1); 515 1);
516 NavigateToDestURL(); 516 NavigateToDestURL();
517 } 517 }
518 518
519 // Renders a page that contains a prerender link to a page that contains an 519 // Renders a page that contains a prerender link to a page that contains an
520 // iframe with a source that requires http authentication. This should not 520 // iframe with a source that requires http authentication. This should not
521 // prerender successfully. 521 // prerender successfully.
522 // Flaky, and crbug.com was down when discovered, so no crbug entry. 522 // Flaky: http://crbug.com/82913.
523 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 523 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
524 DISABLED_PrerenderHttpAuthentication) { 524 FLAKY_PrerenderHttpAuthentication) {
525 PrerenderTestURL("files/prerender/prerender_http_auth_container.html", 525 PrerenderTestURL("files/prerender/prerender_http_auth_container.html",
526 FINAL_STATUS_AUTH_NEEDED, 526 FINAL_STATUS_AUTH_NEEDED,
527 1); 527 1);
528 } 528 }
529 529
530 // Checks that client-issued redirects work with prerendering. 530 // Checks that client-issued redirects work with prerendering.
531 // This version navigates to the page which issues the redirection, rather 531 // This version navigates to the page which issues the redirection, rather
532 // than the final destination page. 532 // than the final destination page.
533 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 533 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
534 PrerenderClientRedirectNavigateToFirst) { 534 PrerenderClientRedirectNavigateToFirst) {
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 PrerenderTestURL("files/prerender/prerender_page.html", 1139 PrerenderTestURL("files/prerender/prerender_page.html",
1140 FINAL_STATUS_WINDOW_OPENER, 1140 FINAL_STATUS_WINDOW_OPENER,
1141 1); 1141 1);
1142 OpenDestUrlInNewWindowViaClick(); 1142 OpenDestUrlInNewWindowViaClick();
1143 } 1143 }
1144 1144
1145 // TODO(shishir): Add a test for the case when the page having the 1145 // TODO(shishir): Add a test for the case when the page having the
1146 // prerendering link already has an opener set. 1146 // prerendering link already has an opener set.
1147 1147
1148 } // namespace prerender 1148 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_contents.h » ('j') | chrome/browser/prerender/prerender_contents.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698