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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.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.h" | 9 #include "base/message_loop.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void set_default_download_path(const base::FilePath& path) { | 86 void set_default_download_path(const base::FilePath& path) { |
87 default_download_path_ = path; | 87 default_download_path_ = path; |
88 } | 88 } |
89 // Creates a name of form 'a'*repeat + suffix | 89 // Creates a name of form 'a'*repeat + suffix |
90 base::FilePath GetLongNamePathInDownloadsDirectory( | 90 base::FilePath GetLongNamePathInDownloadsDirectory( |
91 size_t repeat, const base::FilePath::CharType* suffix); | 91 size_t repeat, const base::FilePath::CharType* suffix); |
92 | 92 |
93 protected: | 93 protected: |
94 base::ScopedTempDir test_download_dir_; | 94 base::ScopedTempDir test_download_dir_; |
95 base::FilePath default_download_path_; | 95 base::FilePath default_download_path_; |
96 MessageLoopForUI message_loop_; | 96 base::MessageLoopForUI message_loop_; |
97 content::TestBrowserThread ui_thread_; | 97 content::TestBrowserThread ui_thread_; |
98 content::TestBrowserThread file_thread_; | 98 content::TestBrowserThread file_thread_; |
99 | 99 |
100 private: | 100 private: |
101 void TestReservedPathCallback(base::FilePath* return_path, | 101 void TestReservedPathCallback(base::FilePath* return_path, |
102 bool* return_verified, bool* did_run_callback, | 102 bool* return_verified, bool* did_run_callback, |
103 const base::FilePath& path, bool verified); | 103 const base::FilePath& path, bool verified); |
104 }; | 104 }; |
105 | 105 |
106 DownloadPathReservationTrackerTest::DownloadPathReservationTrackerTest() | 106 DownloadPathReservationTrackerTest::DownloadPathReservationTrackerTest() |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 base::FilePath reserved_path; | 558 base::FilePath reserved_path; |
559 bool verified = false; | 559 bool verified = false; |
560 DownloadPathReservationTracker::FilenameConflictAction conflict_action = | 560 DownloadPathReservationTracker::FilenameConflictAction conflict_action = |
561 DownloadPathReservationTracker::OVERWRITE; | 561 DownloadPathReservationTracker::OVERWRITE; |
562 CallGetReservedPath(*item, path, conflict_action, &reserved_path, &verified); | 562 CallGetReservedPath(*item, path, conflict_action, &reserved_path, &verified); |
563 // We cannot truncate a path with very long extension. | 563 // We cannot truncate a path with very long extension. |
564 EXPECT_FALSE(verified); | 564 EXPECT_FALSE(verified); |
565 } | 565 } |
566 | 566 |
567 #endif | 567 #endif |
OLD | NEW |