| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 bool create_directory = false; | 496 bool create_directory = false; |
| 497 CallGetReservedPath( | 497 CallGetReservedPath( |
| 498 item.get(), | 498 item.get(), |
| 499 path, | 499 path, |
| 500 create_directory, | 500 create_directory, |
| 501 conflict_action, | 501 conflict_action, |
| 502 &reserved_path, | 502 &reserved_path, |
| 503 &verified); | 503 &verified); |
| 504 // Verification fails. | 504 // Verification fails. |
| 505 EXPECT_FALSE(verified); | 505 EXPECT_FALSE(verified); |
| 506 #if BUILDFLAG(ANDROID_JAVA_UI) | 506 #if defined(OS_ANDROID) |
| 507 EXPECT_TRUE(reserved_path.empty()); | 507 EXPECT_TRUE(reserved_path.empty()); |
| 508 #else | 508 #else |
| 509 EXPECT_EQ(path.BaseName().value(), reserved_path.BaseName().value()); | 509 EXPECT_EQ(path.BaseName().value(), reserved_path.BaseName().value()); |
| 510 #endif | 510 #endif |
| 511 } | 511 } |
| 512 SetDownloadItemState(item.get(), DownloadItem::COMPLETE); | 512 SetDownloadItemState(item.get(), DownloadItem::COMPLETE); |
| 513 } | 513 } |
| 514 | 514 |
| 515 // If the default download directory doesn't exist, then it should be | 515 // If the default download directory doesn't exist, then it should be |
| 516 // created. But only if we are actually going to create the download path there. | 516 // created. But only if we are actually going to create the download path there. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 create_directory, | 709 create_directory, |
| 710 conflict_action, | 710 conflict_action, |
| 711 &reserved_path, | 711 &reserved_path, |
| 712 &verified); | 712 &verified); |
| 713 // We cannot truncate a path with very long extension. | 713 // We cannot truncate a path with very long extension. |
| 714 EXPECT_FALSE(verified); | 714 EXPECT_FALSE(verified); |
| 715 SetDownloadItemState(item.get(), DownloadItem::COMPLETE); | 715 SetDownloadItemState(item.get(), DownloadItem::COMPLETE); |
| 716 } | 716 } |
| 717 | 717 |
| 718 #endif // Platforms that support filename truncation. | 718 #endif // Platforms that support filename truncation. |
| OLD | NEW |