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

Unified Diff: chrome/browser/history/history_browsertest.cc

Issue 2972793002: Fix did_replace_entry reported as false for meta refresh tags (Closed)
Patch Set: Minor rewrite and updated tests. Created 3 years, 5 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 | « no previous file | chrome/test/data/History/redirector.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_browsertest.cc
diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc
index 9a67bb22ea94a3d538c315e93a8fca51abb63605..ff7f3426c19b5611c0057287181fad3eae185c79 100644
--- a/chrome/browser/history/history_browsertest.cc
+++ b/chrome/browser/history/history_browsertest.cc
@@ -474,11 +474,30 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, Subframe) {
ASSERT_FALSE(HistoryContainsURL(auto_subframe));
}
-// HTTP meta-refresh redirects should have separate history entries.
-IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, RedirectHistory) {
+// HTTP meta-refresh redirects should have separate history entries iff the
+// timeout is > 1 seconds.
+IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, RedirectHistoryFast) {
GURL redirector = ui_test_utils::GetTestUrl(
base::FilePath().AppendASCII("History"),
- base::FilePath().AppendASCII("redirector.html"));
+ base::FilePath().AppendASCII("redirector_fast.html"));
+ GURL landing_url =
+ ui_test_utils::GetTestUrl(base::FilePath().AppendASCII("History"),
+ base::FilePath().AppendASCII("landing.html"));
+ ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(),
+ redirector, 2);
+ ASSERT_EQ(landing_url,
+ browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
+ std::vector<GURL> urls(GetHistoryContents());
+ ASSERT_EQ(1u, urls.size());
+ ASSERT_EQ(landing_url, urls[0]);
+}
+
+// HTTP meta-refresh redirects should have separate history entries iff the
+// timeout is > 1 seconds.
+IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, RedirectHistorySlow) {
+ GURL redirector = ui_test_utils::GetTestUrl(
+ base::FilePath().AppendASCII("History"),
+ base::FilePath().AppendASCII("redirector_slow.html"));
GURL landing_url = ui_test_utils::GetTestUrl(
base::FilePath().AppendASCII("History"),
base::FilePath().AppendASCII("landing.html"));
« no previous file with comments | « no previous file | chrome/test/data/History/redirector.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698