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> |
| 6 |
5 #include "base/command_line.h" | 7 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
7 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
8 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/path_service.h" | 12 #include "base/path_service.h" |
11 #include "base/process/launch.h" | 13 #include "base/process/launch.h" |
| 14 #include "build/build_config.h" |
12 #include "chrome/browser/file_select_helper.h" | 15 #include "chrome/browser/file_select_helper.h" |
13 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
15 | 18 |
16 class FileSelectHelperTest : public testing::Test { | 19 class FileSelectHelperTest : public testing::Test { |
17 public: | 20 public: |
18 FileSelectHelperTest() {} | 21 FileSelectHelperTest() {} |
19 | 22 |
20 protected: | 23 protected: |
21 void SetUp() override { | 24 void SetUp() override { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 base::FilePath::CharType kBadName[] = {0xe3, 0x81, 0x81, 0x81, 0x82, 0}; | 106 base::FilePath::CharType kBadName[] = {0xe3, 0x81, 0x81, 0x81, 0x82, 0}; |
104 #endif | 107 #endif |
105 base::FilePath bad_filename(kBadName); | 108 base::FilePath bad_filename(kBadName); |
106 ASSERT_FALSE(bad_filename.empty()); | 109 ASSERT_FALSE(bad_filename.empty()); |
107 // The only thing we are testing is that if the source filename was non-empty, | 110 // The only thing we are testing is that if the source filename was non-empty, |
108 // the resulting filename is also not empty. Invalid encoded filenames can | 111 // the resulting filename is also not empty. Invalid encoded filenames can |
109 // cause conversions to fail. Such failures shouldn't cause the resulting | 112 // cause conversions to fail. Such failures shouldn't cause the resulting |
110 // filename to disappear. | 113 // filename to disappear. |
111 EXPECT_FALSE(FileSelectHelper::GetSanitizedFileName(bad_filename).empty()); | 114 EXPECT_FALSE(FileSelectHelper::GetSanitizedFileName(bad_filename).empty()); |
112 } | 115 } |
OLD | NEW |