diff options
author | ppi@chromium.org <ppi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 11:51:48 +0000 |
---|---|---|
committer | ppi@chromium.org <ppi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 11:51:48 +0000 |
commit | 4d73c7d7dbd3dab45e942f872ae40319e96a54a6 (patch) | |
tree | 2709cae0964dff80f3db8cc41396eec4ee69356e | |
parent | 0ba659659c6c4c9623dd1308d0282254c6edbe02 (diff) | |
download | chromium_src-4d73c7d7dbd3dab45e942f872ae40319e96a54a6.zip chromium_src-4d73c7d7dbd3dab45e942f872ae40319e96a54a6.tar.gz chromium_src-4d73c7d7dbd3dab45e942f872ae40319e96a54a6.tar.bz2 |
Remove TestWebContents cross-site override that doesn't override anything.
ShouldTransitionCrossSite is set to true in WebContents tests but no one ever
reads the value, as the authorative method is now in RenderFrameHostManager.
This patch removes the broken code.
BUG=None
R=avi@chromium.org, nasko@chromium.org
Review URL: https://codereview.chromium.org/348533004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278679 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/web_contents/web_contents_impl_unittest.cc | 17 | ||||
-rw-r--r-- | content/test/test_web_contents.cc | 1 | ||||
-rw-r--r-- | content/test/test_web_contents.h | 7 |
3 files changed, 0 insertions, 25 deletions
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index b487a16..4c86357 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc @@ -449,7 +449,6 @@ TEST_F(WebContentsImplTest, NavigateToExcessivelyLongURL) { // Test that navigating across a site boundary creates a new RenderViewHost // with a new SiteInstance. Going back should do the same. TEST_F(WebContentsImplTest, CrossSiteBoundaries) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); RenderFrameHostImpl* orig_rfh = contents()->GetFrameTree()->root()->current_frame_host(); @@ -550,7 +549,6 @@ TEST_F(WebContentsImplTest, CrossSiteBoundaries) { // Test that navigating across a site boundary after a crash creates a new // RVH without requiring a cross-site transition (i.e., PENDING state). TEST_F(WebContentsImplTest, CrossSiteBoundariesAfterCrash) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); int orig_rvh_delete_count = 0; orig_rvh->set_delete_counter(&orig_rvh_delete_count); @@ -596,7 +594,6 @@ TEST_F(WebContentsImplTest, CrossSiteBoundariesAfterCrash) { // both contentses to a new site will place both contentses in a single // SiteInstance. TEST_F(WebContentsImplTest, NavigateTwoTabsCrossSite) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); SiteInstance* instance1 = contents()->GetSiteInstance(); @@ -609,7 +606,6 @@ TEST_F(WebContentsImplTest, NavigateTwoTabsCrossSite) { // Open a new contents with the same SiteInstance, navigated to the same site. scoped_ptr<TestWebContents> contents2( TestWebContents::Create(browser_context(), instance1)); - contents2->transition_cross_site = true; contents2->GetController().LoadURL(url, Referrer(), PAGE_TRANSITION_TYPED, std::string()); @@ -659,7 +655,6 @@ TEST_F(WebContentsImplTest, NavigateDoesNotUseUpSiteInstance) { WebContentsImplTestBrowserClient browser_client; SetBrowserClientForTesting(&browser_client); - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); RenderFrameHostImpl* orig_rfh = contents()->GetFrameTree()->root()->current_frame_host(); @@ -748,7 +743,6 @@ TEST_F(WebContentsImplTest, NavigateDoesNotUseUpSiteInstance) { // Test that we can find an opener RVH even if it's pending. // http://crbug.com/176252. TEST_F(WebContentsImplTest, FindOpenerRVHWhenPending) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); // Navigate to a URL. @@ -778,7 +772,6 @@ TEST_F(WebContentsImplTest, FindOpenerRVHWhenPending) { // Tests that WebContentsImpl uses the current URL, not the SiteInstance's site, // to determine whether a navigation is cross-site. TEST_F(WebContentsImplTest, CrossSiteComparesAgainstCurrentPage) { - contents()->transition_cross_site = true; RenderViewHost* orig_rvh = rvh(); SiteInstance* instance1 = contents()->GetSiteInstance(); @@ -792,7 +785,6 @@ TEST_F(WebContentsImplTest, CrossSiteComparesAgainstCurrentPage) { // Open a related contents to a second site. scoped_ptr<TestWebContents> contents2( TestWebContents::Create(browser_context(), instance1)); - contents2->transition_cross_site = true; const GURL url2("http://www.yahoo.com"); contents2->GetController().LoadURL(url2, Referrer(), PAGE_TRANSITION_TYPED, @@ -830,7 +822,6 @@ TEST_F(WebContentsImplTest, CrossSiteComparesAgainstCurrentPage) { // Test that the onbeforeunload and onunload handlers run when navigating // across site boundaries. TEST_F(WebContentsImplTest, CrossSiteUnloadHandlers) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); SiteInstance* instance1 = contents()->GetSiteInstance(); @@ -882,7 +873,6 @@ TEST_F(WebContentsImplTest, CrossSiteUnloadHandlers) { // navigate to a different URL and have it displayed, canceling the slow // navigation. TEST_F(WebContentsImplTest, CrossSiteNavigationPreempted) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); SiteInstance* instance1 = contents()->GetSiteInstance(); @@ -917,8 +907,6 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationPreempted) { } TEST_F(WebContentsImplTest, CrossSiteNavigationBackPreempted) { - contents()->transition_cross_site = true; - // Start with a web ui page, which gets a new RVH with WebUI bindings. const GURL url1("chrome://blah"); controller().LoadURL( @@ -1021,7 +1009,6 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationBackPreempted) { // Test that during a slow cross-site navigation, a sub-frame navigation in the // original renderer will not cancel the slow navigation (bug 42029). TEST_F(WebContentsImplTest, CrossSiteNavigationNotPreemptedByFrame) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); // Navigate to URL. First URL should use first RenderViewHost. @@ -1057,8 +1044,6 @@ TEST_F(WebContentsImplTest, CrossSiteNavigationNotPreemptedByFrame) { // We should only preempt the cross-site navigation if the previous renderer // has started a new navigation. See http://crbug.com/79176. TEST_F(WebContentsImplTest, CrossSiteNotPreemptedDuringBeforeUnload) { - contents()->transition_cross_site = true; - // Navigate to NTP URL. const GURL url("chrome://blah"); controller().LoadURL( @@ -1094,7 +1079,6 @@ TEST_F(WebContentsImplTest, CrossSiteNotPreemptedDuringBeforeUnload) { // is almost ready to be displayed, and the original renderer is only given a // short chance to run an unload handler. Prevents regression of bug 23942. TEST_F(WebContentsImplTest, CrossSiteCantPreemptAfterUnload) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); SiteInstance* instance1 = contents()->GetSiteInstance(); @@ -1152,7 +1136,6 @@ TEST_F(WebContentsImplTest, CrossSiteCantPreemptAfterUnload) { // Test that a cross-site navigation that doesn't commit after the unload // handler doesn't leave the contents in a stuck state. http://crbug.com/88562 TEST_F(WebContentsImplTest, CrossSiteNavigationCanceled) { - contents()->transition_cross_site = true; TestRenderViewHost* orig_rvh = test_rvh(); SiteInstance* instance1 = contents()->GetSiteInstance(); diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index a9c239e2..c337e2b 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc @@ -26,7 +26,6 @@ namespace content { TestWebContents::TestWebContents(BrowserContext* browser_context) : WebContentsImpl(browser_context, NULL), - transition_cross_site(false), delegate_view_override_(NULL), expect_set_history_length_and_prune_(false), expect_set_history_length_and_prune_site_instance_(NULL), diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h index e42abfe..9afa72d 100644 --- a/content/test/test_web_contents.h +++ b/content/test/test_web_contents.h @@ -51,10 +51,6 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { return GetRenderManager()->cross_navigation_pending_; } - // Overrides WebContentsImpl::ShouldTransitionCrossSite so that we can test - // both alternatives without using command-line switches. - bool ShouldTransitionCrossSite() { return transition_cross_site; } - // Prevent interaction with views. virtual bool CreateRenderViewForRenderManager( RenderViewHost* render_view_host, @@ -67,9 +63,6 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { // TestWebContents. The caller owns the returned object. virtual WebContents* Clone() OVERRIDE; - // Set by individual tests. - bool transition_cross_site; - // Allow mocking of the RenderViewHostDelegateView. virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; void set_delegate_view(RenderViewHostDelegateView* view) { |