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

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

Issue 6973052: When the download folder does not exist, change the download folder to a user's "Downloads" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added URLRequestMockHTTPJob.test_dir_ and URLRequestMockHTTPJob.temp_dir_ Created 9 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
Index: chrome/browser/download/download_manager_unittest.cc
diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
index e8cda1c6bc4e0eb8bafab991170948a3fc72a90a..4c7180133eae91ecc21e3be4bcf59ce04e0f8ede 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -235,7 +235,8 @@ class SelectFileObserver : public DownloadManager::Observer {
// Downloadmanager::Observer functions.
virtual void ModelChanged() {}
virtual void ManagerGoingDown() {}
- virtual void SelectFileDialogDisplayed(int32 id) {
+ virtual void SelectFileDialogDisplayed(int32 id,
+ const FilePath& suggested_path) {
file_dialog_ids_.insert(id);
}
@@ -292,8 +293,11 @@ class ItemObserver : public DownloadItem::Observer {
TEST_F(DownloadManagerTest, StartDownload) {
BrowserThread io_thread(BrowserThread::IO, &message_loop_);
+ ScopedTempDir download_save_dir;
+ ASSERT_TRUE(download_save_dir.CreateUniqueTempDir());
PrefService* prefs = profile_->GetPrefs();
- prefs->SetFilePath(prefs::kDownloadDefaultDirectory, FilePath());
+ prefs->SetFilePath(prefs::kDownloadDefaultDirectory,
+ download_save_dir.path());
download_manager_->download_prefs()->EnableAutoOpenBasedOnExtension(
FilePath(FILE_PATH_LITERAL("example.pdf")));

Powered by Google App Engine
This is Rietveld 408576698