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