OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
14 #include "chrome/common/extensions/extension_constants.h" | 14 #include "chrome/common/extensions/extension_constants.h" |
15 #include "chrome/common/extensions/extension_l10n_util.h" | 15 #include "chrome/common/extensions/extension_l10n_util.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 TEST(Extensio8nL10nUtil, GetValidLocalesEmptyLocaleFolder) { | 20 TEST(ExtensionL10nUtil, GetValidLocalesEmptyLocaleFolder) { |
21 ScopedTempDir temp; | 21 ScopedTempDir temp; |
22 ASSERT_TRUE(temp.CreateUniqueTempDir()); | 22 ASSERT_TRUE(temp.CreateUniqueTempDir()); |
23 | 23 |
24 FilePath src_path = temp.path().AppendASCII(Extension::kLocaleFolder); | 24 FilePath src_path = temp.path().AppendASCII(Extension::kLocaleFolder); |
25 ASSERT_TRUE(file_util::CreateDirectory(src_path)); | 25 ASSERT_TRUE(file_util::CreateDirectory(src_path)); |
26 | 26 |
27 std::string error; | 27 std::string error; |
28 std::set<std::string> locales; | 28 std::set<std::string> locales; |
29 EXPECT_FALSE(extension_l10n_util::GetValidLocales(src_path, | 29 EXPECT_FALSE(extension_l10n_util::GetValidLocales(src_path, |
30 &locales, | 30 &locales, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 for (size_t i = 0; i < locales.size(); ++i) { | 223 for (size_t i = 0; i < locales.size(); ++i) { |
224 FilePath tmp; | 224 FilePath tmp; |
225 tmp = tmp.AppendASCII(Extension::kLocaleFolder) | 225 tmp = tmp.AppendASCII(Extension::kLocaleFolder) |
226 .AppendASCII(locales[i]).AppendASCII("foo/bar.js"); | 226 .AppendASCII(locales[i]).AppendASCII("foo/bar.js"); |
227 EXPECT_TRUE(PathsAreEqual(tmp, l10n_paths[i])); | 227 EXPECT_TRUE(PathsAreEqual(tmp, l10n_paths[i])); |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 } // namespace | 231 } // namespace |
OLD | NEW |