| OLD | NEW |
| 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using testing::ReturnRef; | 25 using testing::ReturnRef; |
| 26 using testing::ReturnRefOfCopy; | 26 using testing::ReturnRefOfCopy; |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 class DownloadPathReservationTrackerTest : public testing::Test { | 30 class DownloadPathReservationTrackerTest : public testing::Test { |
| 31 public: | 31 public: |
| 32 DownloadPathReservationTrackerTest(); | 32 DownloadPathReservationTrackerTest(); |
| 33 | 33 |
| 34 // testing::Test | 34 // testing::Test |
| 35 virtual void SetUp() OVERRIDE; | 35 virtual void SetUp() override; |
| 36 virtual void TearDown() OVERRIDE; | 36 virtual void TearDown() override; |
| 37 | 37 |
| 38 MockDownloadItem* CreateDownloadItem(int32 id); | 38 MockDownloadItem* CreateDownloadItem(int32 id); |
| 39 base::FilePath GetPathInDownloadsDirectory( | 39 base::FilePath GetPathInDownloadsDirectory( |
| 40 const base::FilePath::CharType* suffix); | 40 const base::FilePath::CharType* suffix); |
| 41 bool IsPathInUse(const base::FilePath& path); | 41 bool IsPathInUse(const base::FilePath& path); |
| 42 void CallGetReservedPath( | 42 void CallGetReservedPath( |
| 43 DownloadItem* download_item, | 43 DownloadItem* download_item, |
| 44 const base::FilePath& target_path, | 44 const base::FilePath& target_path, |
| 45 bool create_directory, | 45 bool create_directory, |
| 46 DownloadPathReservationTracker::FilenameConflictAction conflict_action, | 46 DownloadPathReservationTracker::FilenameConflictAction conflict_action, |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 create_directory, | 665 create_directory, |
| 666 conflict_action, | 666 conflict_action, |
| 667 &reserved_path, | 667 &reserved_path, |
| 668 &verified); | 668 &verified); |
| 669 // We cannot truncate a path with very long extension. | 669 // We cannot truncate a path with very long extension. |
| 670 EXPECT_FALSE(verified); | 670 EXPECT_FALSE(verified); |
| 671 SetDownloadItemState(item.get(), DownloadItem::COMPLETE); | 671 SetDownloadItemState(item.get(), DownloadItem::COMPLETE); |
| 672 } | 672 } |
| 673 | 673 |
| 674 #endif | 674 #endif |
| OLD | NEW |