| 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/string_split.h" | 7 #include "base/string_split.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/api/file_system/file_system_api.h" | 9 #include "chrome/browser/extensions/api/file_system/file_system_api.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 if (!extensions.empty()) { | 42 if (!extensions.empty()) { |
| 43 option->extensions.reset(new std::vector<std::string>()); | 43 option->extensions.reset(new std::vector<std::string>()); |
| 44 base::SplitString(extensions, ',', option->extensions.get()); | 44 base::SplitString(extensions, ',', option->extensions.get()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 return option; | 47 return option; |
| 48 } | 48 } |
| 49 | 49 |
| 50 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 51 #define ToStringType base::UTF8ToWide | 51 #define ToStringType UTF8ToWide |
| 52 #else | 52 #else |
| 53 #define ToStringType | 53 #define ToStringType |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 class FileSystemApiUnitTest : public testing::Test { | 58 class FileSystemApiUnitTest : public testing::Test { |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { | 61 TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // TODO(thorogood): Fix this test on Windows. | 178 // TODO(thorogood): Fix this test on Windows. |
| 179 // Filter out absolute paths with no basename. | 179 // Filter out absolute paths with no basename. |
| 180 opt_name = std::string("/"); | 180 opt_name = std::string("/"); |
| 181 FileSystemChooseEntryFunction::BuildSuggestion(&opt_name, &suggested_name, | 181 FileSystemChooseEntryFunction::BuildSuggestion(&opt_name, &suggested_name, |
| 182 &suggested_extension); | 182 &suggested_extension); |
| 183 EXPECT_FALSE(suggested_name.IsAbsolute()); | 183 EXPECT_FALSE(suggested_name.IsAbsolute()); |
| 184 EXPECT_TRUE(suggested_name.MaybeAsASCII().empty()); | 184 EXPECT_TRUE(suggested_name.MaybeAsASCII().empty()); |
| 185 EXPECT_TRUE(suggested_extension.empty()); | 185 EXPECT_TRUE(suggested_extension.empty()); |
| 186 #endif | 186 #endif |
| 187 } | 187 } |
| OLD | NEW |