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

Side by Side Diff: content/browser/download/download_manager_impl_unittest.cc

Issue 2924433002: Change linux default hidden file save directory to XDG_DATA_HOME (Closed)
Patch Set: Fix DownloadManagerTest.StartDownload Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/download/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 uint32_t local_id(5); // Random value 540 uint32_t local_id(5); // Random value
541 base::FilePath download_path(FILE_PATH_LITERAL("download/path")); 541 base::FilePath download_path(FILE_PATH_LITERAL("download/path"));
542 542
543 EXPECT_FALSE(download_manager_->GetDownload(local_id)); 543 EXPECT_FALSE(download_manager_->GetDownload(local_id));
544 544
545 EXPECT_CALL(GetMockObserver(), OnDownloadCreated(download_manager_.get(), _)) 545 EXPECT_CALL(GetMockObserver(), OnDownloadCreated(download_manager_.get(), _))
546 .WillOnce(Return()); 546 .WillOnce(Return());
547 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId(_)) 547 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId(_))
548 .WillOnce(RunCallback<0>(local_id)); 548 .WillOnce(RunCallback<0>(local_id));
549 549
550 #if !defined(OS_LINUX) || defined(OS_CHROMEOS)
550 // Doing nothing will set the default download directory to null. 551 // Doing nothing will set the default download directory to null.
551 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _, _)); 552 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _, _));
553 #endif
552 EXPECT_CALL(GetMockDownloadManagerDelegate(), 554 EXPECT_CALL(GetMockDownloadManagerDelegate(),
553 ApplicationClientIdForFileScanning()) 555 ApplicationClientIdForFileScanning())
554 .WillRepeatedly(Return("client-id")); 556 .WillRepeatedly(Return("client-id"));
555 MockDownloadFile* mock_file = new MockDownloadFile; 557 MockDownloadFile* mock_file = new MockDownloadFile;
556 EXPECT_CALL(*mock_download_file_factory_.get(), 558 EXPECT_CALL(*mock_download_file_factory_.get(),
557 MockCreateFile(Ref(*info->save_info.get()), stream.get())) 559 MockCreateFile(Ref(*info->save_info.get()), stream.get()))
558 .WillOnce(Return(mock_file)); 560 .WillOnce(Return(mock_file));
559 561
560 download_manager_->StartDownload(std::move(info), std::move(stream), 562 download_manager_->StartDownload(std::move(info), std::move(stream),
561 DownloadUrlParameters::OnStartedCallback()); 563 DownloadUrlParameters::OnStartedCallback());
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); 650 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0);
649 651
650 base::Callback<bool(const GURL&)> url_filter = 652 base::Callback<bool(const GURL&)> url_filter =
651 GetSingleURLFilter(download_urls_[0]); 653 GetSingleURLFilter(download_urls_[0]);
652 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( 654 int remove_count = download_manager_->RemoveDownloadsByURLAndTime(
653 url_filter, base::Time(), base::Time::Max()); 655 url_filter, base::Time(), base::Time::Max());
654 EXPECT_EQ(remove_count, 1); 656 EXPECT_EQ(remove_count, 1);
655 } 657 }
656 658
657 } // namespace content 659 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698