| 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_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/memory/linked_ptr.h" | 7 #include "base/memory/linked_ptr.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 TEST(ExtensionL10nUtil, ShouldRelocalizeManifestDifferentCurrentLocale) { | 610 TEST(ExtensionL10nUtil, ShouldRelocalizeManifestDifferentCurrentLocale) { |
| 611 DictionaryValue manifest; | 611 DictionaryValue manifest; |
| 612 manifest.SetString(keys::kDefaultLocale, "en_US"); | 612 manifest.SetString(keys::kDefaultLocale, "en_US"); |
| 613 manifest.SetString(keys::kCurrentLocale, "sr"); | 613 manifest.SetString(keys::kCurrentLocale, "sr"); |
| 614 | 614 |
| 615 ExtensionInfo info(&manifest, "", FilePath(), Extension::LOAD); | 615 ExtensionInfo info(&manifest, "", FilePath(), Extension::LOAD); |
| 616 | 616 |
| 617 EXPECT_TRUE(extension_l10n_util::ShouldRelocalizeManifest(info)); | 617 EXPECT_TRUE(extension_l10n_util::ShouldRelocalizeManifest(info)); |
| 618 } | 618 } |
| 619 | 619 |
| 620 TEST(ExtensionL10nUtil, GetAllFallbackLocales) { |
| 621 std::vector<std::string> fallback_locales; |
| 622 extension_l10n_util::GetAllFallbackLocales("en_US", "all", &fallback_locales); |
| 623 ASSERT_EQ(3U, fallback_locales.size()); |
| 624 |
| 625 CHECK_EQ("en_US", fallback_locales[0]); |
| 626 CHECK_EQ("en", fallback_locales[1]); |
| 627 CHECK_EQ("all", fallback_locales[2]); |
| 628 } |
| 629 |
| 620 } // namespace | 630 } // namespace |
| OLD | NEW |