Index: chrome/browser/download/download_browsertest.cc |
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc |
index 4241720eae8795a96386064885e051646457a48d..9b1a12371e81756b52063ce7a9bf3fd4382473d7 100644 |
--- a/chrome/browser/download/download_browsertest.cc |
+++ b/chrome/browser/download/download_browsertest.cc |
@@ -1414,8 +1414,13 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) { |
int64 origin_size; |
file_util::GetFileSize(origin_file, &origin_size); |
+ // We use the server so that we can get a redirect and test url_chain |
+ // persistence. |
+ ASSERT_TRUE(test_server()->Start()); |
+ GURL redirect_url = test_server()->GetURL("server-redirect?" + url.spec()); |
+ |
// Download the file and wait. We do not expect the Select File dialog. |
- DownloadAndWait(browser(), url); |
+ DownloadAndWait(browser(), redirect_url); |
// Get details of what downloads have just happened. |
std::vector<DownloadItem*> downloads; |
@@ -1434,8 +1439,12 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) { |
DownloadManagerForBrowser(browser())); |
DownloadPersistentStoreInfo info; |
EXPECT_TRUE(history_collector.GetDownloadsHistoryEntry(&info)) << db_handle; |
- EXPECT_EQ(file, info.path.BaseName()); |
- EXPECT_EQ(url, info.url); |
+ EXPECT_EQ(file, info.target_path.BaseName()); |
+ ASSERT_EQ(2u, info.url_chain.size()); |
+ EXPECT_EQ(redirect_url, info.url_chain[0]); |
+ EXPECT_EQ(url, info.url_chain[1]); |
+ EXPECT_EQ(DestinationFile(browser(), file), info.target_path); |
+ EXPECT_EQ(DestinationFile(browser(), file), info.current_path); |
// Ignore start_time. |
EXPECT_EQ(origin_size, info.received_bytes); |
EXPECT_EQ(origin_size, info.total_bytes); |