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

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

Issue 2948443002: [Merge to M60] Change linux default hidden file save directory to XDG_DATA_HOME (Closed)
Patch Set: 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 uint32_t local_id(5); // Random value 539 uint32_t local_id(5); // Random value
540 base::FilePath download_path(FILE_PATH_LITERAL("download/path")); 540 base::FilePath download_path(FILE_PATH_LITERAL("download/path"));
541 541
542 EXPECT_FALSE(download_manager_->GetDownload(local_id)); 542 EXPECT_FALSE(download_manager_->GetDownload(local_id));
543 543
544 EXPECT_CALL(GetMockObserver(), OnDownloadCreated(download_manager_.get(), _)) 544 EXPECT_CALL(GetMockObserver(), OnDownloadCreated(download_manager_.get(), _))
545 .WillOnce(Return()); 545 .WillOnce(Return());
546 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId(_)) 546 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetNextId(_))
547 .WillOnce(RunCallback<0>(local_id)); 547 .WillOnce(RunCallback<0>(local_id));
548 548
549 #if !defined(OS_LINUX) || defined(OS_CHROMEOS)
549 // Doing nothing will set the default download directory to null. 550 // Doing nothing will set the default download directory to null.
550 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _, _)); 551 EXPECT_CALL(GetMockDownloadManagerDelegate(), GetSaveDir(_, _, _, _));
552 #endif
551 EXPECT_CALL(GetMockDownloadManagerDelegate(), 553 EXPECT_CALL(GetMockDownloadManagerDelegate(),
552 ApplicationClientIdForFileScanning()) 554 ApplicationClientIdForFileScanning())
553 .WillRepeatedly(Return("client-id")); 555 .WillRepeatedly(Return("client-id"));
554 MockDownloadFile* mock_file = new MockDownloadFile; 556 MockDownloadFile* mock_file = new MockDownloadFile;
555 EXPECT_CALL(*mock_download_file_factory_.get(), 557 EXPECT_CALL(*mock_download_file_factory_.get(),
556 MockCreateFile(Ref(*info->save_info.get()), stream.get())) 558 MockCreateFile(Ref(*info->save_info.get()), stream.get()))
557 .WillOnce(Return(mock_file)); 559 .WillOnce(Return(mock_file));
558 560
559 download_manager_->StartDownload(std::move(info), std::move(stream), 561 download_manager_->StartDownload(std::move(info), std::move(stream),
560 DownloadUrlParameters::OnStartedCallback()); 562 DownloadUrlParameters::OnStartedCallback());
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); 649 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0);
648 650
649 base::Callback<bool(const GURL&)> url_filter = 651 base::Callback<bool(const GURL&)> url_filter =
650 GetSingleURLFilter(download_urls_[0]); 652 GetSingleURLFilter(download_urls_[0]);
651 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( 653 int remove_count = download_manager_->RemoveDownloadsByURLAndTime(
652 url_filter, base::Time(), base::Time::Max()); 654 url_filter, base::Time(), base::Time::Max());
653 EXPECT_EQ(remove_count, 1); 655 EXPECT_EQ(remove_count, 1);
654 } 656 }
655 657
656 } // namespace content 658 } // 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