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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 void set_default_download_path(const base::FilePath& path) { | 87 void set_default_download_path(const base::FilePath& path) { |
88 default_download_path_ = path; | 88 default_download_path_ = path; |
89 } | 89 } |
90 // Creates a name of form 'a'*repeat + suffix | 90 // Creates a name of form 'a'*repeat + suffix |
91 base::FilePath GetLongNamePathInDownloadsDirectory( | 91 base::FilePath GetLongNamePathInDownloadsDirectory( |
92 size_t repeat, const base::FilePath::CharType* suffix); | 92 size_t repeat, const base::FilePath::CharType* suffix); |
93 | 93 |
94 protected: | 94 protected: |
95 base::ScopedTempDir test_download_dir_; | 95 base::ScopedTempDir test_download_dir_; |
96 base::FilePath default_download_path_; | 96 base::FilePath default_download_path_; |
97 MessageLoopForUI message_loop_; | 97 base::MessageLoopForUI message_loop_; |
98 content::TestBrowserThread ui_thread_; | 98 content::TestBrowserThread ui_thread_; |
99 content::TestBrowserThread file_thread_; | 99 content::TestBrowserThread file_thread_; |
100 | 100 |
101 private: | 101 private: |
102 void TestReservedPathCallback(base::FilePath* return_path, | 102 void TestReservedPathCallback(base::FilePath* return_path, |
103 bool* return_verified, bool* did_run_callback, | 103 bool* return_verified, bool* did_run_callback, |
104 const base::FilePath& path, bool verified); | 104 const base::FilePath& path, bool verified); |
105 }; | 105 }; |
106 | 106 |
107 DownloadPathReservationTrackerTest::DownloadPathReservationTrackerTest() | 107 DownloadPathReservationTrackerTest::DownloadPathReservationTrackerTest() |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 path, | 671 path, |
672 create_directory, | 672 create_directory, |
673 conflict_action, | 673 conflict_action, |
674 &reserved_path, | 674 &reserved_path, |
675 &verified); | 675 &verified); |
676 // We cannot truncate a path with very long extension. | 676 // We cannot truncate a path with very long extension. |
677 EXPECT_FALSE(verified); | 677 EXPECT_FALSE(verified); |
678 } | 678 } |
679 | 679 |
680 #endif | 680 #endif |
OLD | NEW |