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

Unified Diff: content/browser/frame_host/navigation_controller_impl_browsertest.cc

Issue 2772983003: Prevent tests using data URLs from being broken by data URL deprecation (Closed)
Patch Set: nasko comments Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_browsertest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index 27e9a466f6723d4f74c90004e9fe4eda36c6c96f..b38f3b40d3bb3e23f389f4018d4eb07683281389 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -507,21 +507,25 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
NavigationController& controller =
shell()->web_contents()->GetController();
- EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page1")));
+ EXPECT_TRUE(NavigateToURL(
+ shell(), embedded_test_server()->GetURL("/simple_page.html")));
EXPECT_EQ(1, controller.GetEntryCount());
EXPECT_EQ(1, RendererHistoryLength(shell()));
- EXPECT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page1a")));
+ EXPECT_TRUE(RendererLocationReplace(
+ shell(), embedded_test_server()->GetURL("/title1.html")));
EXPECT_EQ(1, controller.GetEntryCount());
EXPECT_EQ(1, RendererHistoryLength(shell()));
// Now create two more entries and go back, to test replacing an entry without
// pruning the forward history.
- EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page2")));
+ EXPECT_TRUE(
+ NavigateToURL(shell(), embedded_test_server()->GetURL("/title2.html")));
EXPECT_EQ(2, controller.GetEntryCount());
EXPECT_EQ(2, RendererHistoryLength(shell()));
- EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page3")));
+ EXPECT_TRUE(
+ NavigateToURL(shell(), embedded_test_server()->GetURL("/title3.html")));
EXPECT_EQ(3, controller.GetEntryCount());
EXPECT_EQ(3, RendererHistoryLength(shell()));
@@ -531,7 +535,8 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
EXPECT_TRUE(controller.CanGoForward());
- EXPECT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page1b")));
+ EXPECT_TRUE(RendererLocationReplace(
+ shell(), embedded_test_server()->GetURL("/simple_page.html?page1b")));
EXPECT_EQ(3, controller.GetEntryCount());
EXPECT_EQ(3, RendererHistoryLength(shell()));
EXPECT_TRUE(controller.CanGoForward());
@@ -6278,18 +6283,23 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
InPageNavigationDoesNotClearFavicon) {
// Load a page and fake a favicon for it.
NavigationController& controller = shell()->web_contents()->GetController();
- ASSERT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page1")));
+ ASSERT_TRUE(NavigateToURL(
+ shell(), embedded_test_server()->GetURL("/simple_page.html")));
content::NavigationEntry* entry = controller.GetLastCommittedEntry();
ASSERT_TRUE(entry);
content::FaviconStatus& favicon_status = entry->GetFavicon();
favicon_status.valid = true;
- ASSERT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page1#")));
+ ASSERT_TRUE(RendererLocationReplace(
+ shell(), embedded_test_server()->GetURL(
+ "/simple_page.html#same-document-navigation")));
entry = controller.GetLastCommittedEntry();
content::FaviconStatus& favicon_status2 = entry->GetFavicon();
EXPECT_TRUE(favicon_status2.valid);
- ASSERT_TRUE(RendererLocationReplace(shell(), GURL("data:text/html,page2")));
+ ASSERT_TRUE(RendererLocationReplace(
+ shell(),
+ embedded_test_server()->GetURL("/simple_page.html?new-navigation")));
entry = controller.GetLastCommittedEntry();
content::FaviconStatus& favicon_status3 = entry->GetFavicon();
EXPECT_FALSE(favicon_status3.valid);
« no previous file with comments | « components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698