| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/logging.h" | |
| 9 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 11 #include "chrome/browser/download/save_package.h" | 10 #include "chrome/browser/download/save_package.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 12 |
| 14 #define FPL FILE_PATH_LITERAL | 13 #define FPL FILE_PATH_LITERAL |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 // This constant copied from save_package.cc. | 17 // This constant copied from save_package.cc. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 EXPECT_TRUE(HasOrdinalNumber(filename)); | 166 EXPECT_TRUE(HasOrdinalNumber(filename)); |
| 168 | 167 |
| 169 // Test that the filename is successfully shortened to fit, and gets a | 168 // Test that the filename is successfully shortened to fit, and gets a |
| 170 // different ordinal appended. | 169 // different ordinal appended. |
| 171 FilePath::StringType filename2; | 170 FilePath::StringType filename2; |
| 172 ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename2)); | 171 ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename2)); |
| 173 EXPECT_TRUE(filename2.length() < long_file.length()); | 172 EXPECT_TRUE(filename2.length() < long_file.length()); |
| 174 EXPECT_TRUE(HasOrdinalNumber(filename2)); | 173 EXPECT_TRUE(HasOrdinalNumber(filename2)); |
| 175 EXPECT_NE(filename, filename2); | 174 EXPECT_NE(filename, filename2); |
| 176 } | 175 } |
| OLD | NEW |