| 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/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/memory/linked_ptr.h" | 8 #include "base/memory/linked_ptr.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.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_l10n_util.h" | 13 #include "chrome/common/extensions/extension_l10n_util.h" |
| 14 #include "chrome/common/extensions/extension_manifest_constants.h" | 14 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 15 #include "chrome/common/extensions/message_bundle.h" | 15 #include "chrome/common/extensions/message_bundle.h" |
| 16 #include "extensions/common/constants.h" | 16 #include "extensions/common/constants.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 19 | 19 |
| 20 using extensions::kLocaleFolder; | 20 using extensions::kLocaleFolder; |
| 21 using extensions::kMessagesFilename; | 21 using extensions::kMessagesFilename; |
| 22 using extensions::MessageBundle; | 22 using extensions::MessageBundle; |
| 23 | 23 |
| 24 namespace errors = extension_manifest_errors; | 24 namespace errors = extension_manifest_errors; |
| 25 namespace keys = extension_manifest_keys; | 25 namespace keys = extensions::manifest_keys; |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 TEST(ExtensionL10nUtil, GetValidLocalesEmptyLocaleFolder) { | 29 TEST(ExtensionL10nUtil, GetValidLocalesEmptyLocaleFolder) { |
| 30 base::ScopedTempDir temp; | 30 base::ScopedTempDir temp; |
| 31 ASSERT_TRUE(temp.CreateUniqueTempDir()); | 31 ASSERT_TRUE(temp.CreateUniqueTempDir()); |
| 32 | 32 |
| 33 base::FilePath src_path = temp.path().Append(kLocaleFolder); | 33 base::FilePath src_path = temp.path().Append(kLocaleFolder); |
| 34 ASSERT_TRUE(file_util::CreateDirectory(src_path)); | 34 ASSERT_TRUE(file_util::CreateDirectory(src_path)); |
| 35 | 35 |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 std::vector<std::string> fallback_locales; | 490 std::vector<std::string> fallback_locales; |
| 491 extension_l10n_util::GetAllFallbackLocales("en_US", "all", &fallback_locales); | 491 extension_l10n_util::GetAllFallbackLocales("en_US", "all", &fallback_locales); |
| 492 ASSERT_EQ(3U, fallback_locales.size()); | 492 ASSERT_EQ(3U, fallback_locales.size()); |
| 493 | 493 |
| 494 CHECK_EQ("en_US", fallback_locales[0]); | 494 CHECK_EQ("en_US", fallback_locales[0]); |
| 495 CHECK_EQ("en", fallback_locales[1]); | 495 CHECK_EQ("en", fallback_locales[1]); |
| 496 CHECK_EQ("all", fallback_locales[2]); | 496 CHECK_EQ("all", fallback_locales[2]); |
| 497 } | 497 } |
| 498 | 498 |
| 499 } // namespace | 499 } // namespace |
| OLD | NEW |