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

Unified Diff: chrome/browser/download/download_browsertest.cc

Issue 11363222: Persist download interrupt reason, both target and current paths, and url_chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
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..079098c873d82a52ce81950395951b1d885bb206 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,10 @@ 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]);
// Ignore start_time.
EXPECT_EQ(origin_size, info.received_bytes);
EXPECT_EQ(origin_size, info.total_bytes);

Powered by Google App Engine
This is Rietveld 408576698