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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_unittest.cc

Issue 1270843002: PlzNavigate: disable RenderFrameHostManagerTest::PageDoesBackAndReload. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment change. Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/histogram_tester.h" 8 #include "base/test/histogram_tester.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 10 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
(...skipping 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 const GURL kUrl2("http://www.google.com"); 1209 const GURL kUrl2("http://www.google.com");
1210 contents()->NavigateAndCommit(kUrl2); 1210 contents()->NavigateAndCommit(kUrl2);
1211 EXPECT_FALSE(main_test_rfh()->frame_tree_node()->render_manager()->web_ui()); 1211 EXPECT_FALSE(main_test_rfh()->frame_tree_node()->render_manager()->web_ui());
1212 } 1212 }
1213 1213
1214 // Tests that we don't end up in an inconsistent state if a page does a back and 1214 // Tests that we don't end up in an inconsistent state if a page does a back and
1215 // then reload. http://crbug.com/51680 1215 // then reload. http://crbug.com/51680
1216 // Also tests that only user-gesture navigations can interrupt cross-process 1216 // Also tests that only user-gesture navigations can interrupt cross-process
1217 // navigations. http://crbug.com/75195 1217 // navigations. http://crbug.com/75195
1218 TEST_F(RenderFrameHostManagerTest, PageDoesBackAndReload) { 1218 TEST_F(RenderFrameHostManagerTest, PageDoesBackAndReload) {
1219 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
1220 switches::kEnableBrowserSideNavigation)) {
1221 // PlzNavigate uses a significantly different logic for renderer initiated
1222 // navigations and navigation cancellation. Adapting this test would make it
1223 // full of special cases and almost unreadable.
1224 // There are tests that exercise these concerns for PlzNavigate, all from
1225 // NavigatorTestWithBrowserSideNavigation:
1226 // - BrowserInitiatedNavigationCancel
1227 // - RendererUserInitiatedNavigationCancel
1228 // - RendererNonUserInitiatedNavigationDoesntCancelRendererUserInitiated
1229 // - RendererNonUserInitiatedNavigationDoesntCancelBrowserInitiated
1230 // - RendererNonUserInitiatedNavigationCancelSimilarNavigation
1231 SUCCEED() << "Test is not applicable with browser side navigation enabled";
1232 return;
1233 }
1219 const GURL kUrl1("http://www.google.com/"); 1234 const GURL kUrl1("http://www.google.com/");
1220 const GURL kUrl2("http://www.evil-site.com/"); 1235 const GURL kUrl2("http://www.evil-site.com/");
1221 1236
1222 // Navigate to a safe site, then an evil site. 1237 // Navigate to a safe site, then an evil site.
1223 // This will switch RenderFrameHosts. We cannot assert that the first and 1238 // This will switch RenderFrameHosts. We cannot assert that the first and
1224 // second RFHs are different, though, because the first one may be promptly 1239 // second RFHs are different, though, because the first one may be promptly
1225 // deleted. 1240 // deleted.
1226 contents()->NavigateAndCommit(kUrl1); 1241 contents()->NavigateAndCommit(kUrl1);
1227 contents()->NavigateAndCommit(kUrl2); 1242 contents()->NavigateAndCommit(kUrl2);
1228 TestRenderFrameHost* evil_rfh = contents()->GetMainFrame(); 1243 TestRenderFrameHost* evil_rfh = contents()->GetMainFrame();
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive()); 2228 EXPECT_FALSE(contents2->GetMainFrame()->IsRenderFrameLive());
2214 contents2->NavigateAndCommit(kUrl3); 2229 contents2->NavigateAndCommit(kUrl3);
2215 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive()); 2230 EXPECT_TRUE(contents2->GetMainFrame()->IsRenderFrameLive());
2216 EXPECT_NE(nullptr, 2231 EXPECT_NE(nullptr,
2217 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance())); 2232 iframe->GetRenderFrameProxyHost(contents1->GetSiteInstance()));
2218 EXPECT_EQ(nullptr, 2233 EXPECT_EQ(nullptr,
2219 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance())); 2234 iframe->GetRenderFrameProxyHost(contents2->GetSiteInstance()));
2220 } 2235 }
2221 2236
2222 } // namespace content 2237 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698