Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: chrome/common/extensions/extension_l10n_util_unittest.cc

Issue 93793010: Update uses of UTF conversions in chrome/common to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
(...skipping 30 matching lines...) Expand all
41 std::string data = "{ \"name\":"; 41 std::string data = "{ \"name\":";
42 ASSERT_TRUE(file_util::WriteFile(messages_file, data.c_str(), data.length())); 42 ASSERT_TRUE(file_util::WriteFile(messages_file, data.c_str(), data.length()));
43 43
44 base::DictionaryValue manifest; 44 base::DictionaryValue manifest;
45 manifest.SetString(keys::kDefaultLocale, "en"); 45 manifest.SetString(keys::kDefaultLocale, "en");
46 std::string error; 46 std::string error;
47 EXPECT_FALSE(extension_l10n_util::ValidateExtensionLocales( 47 EXPECT_FALSE(extension_l10n_util::ValidateExtensionLocales(
48 temp.path(), &manifest, &error)); 48 temp.path(), &manifest, &error));
49 EXPECT_THAT(error, 49 EXPECT_THAT(error,
50 testing::HasSubstr( 50 testing::HasSubstr(
51 UTF16ToUTF8(messages_file.LossyDisplayName()))); 51 base::UTF16ToUTF8(messages_file.LossyDisplayName())));
52 } 52 }
53 53
54 TEST(ExtensionL10nUtil, GetValidLocalesEmptyLocaleFolder) { 54 TEST(ExtensionL10nUtil, GetValidLocalesEmptyLocaleFolder) {
55 base::ScopedTempDir temp; 55 base::ScopedTempDir temp;
56 ASSERT_TRUE(temp.CreateUniqueTempDir()); 56 ASSERT_TRUE(temp.CreateUniqueTempDir());
57 57
58 base::FilePath src_path = temp.path().Append(kLocaleFolder); 58 base::FilePath src_path = temp.path().Append(kLocaleFolder);
59 ASSERT_TRUE(base::CreateDirectory(src_path)); 59 ASSERT_TRUE(base::CreateDirectory(src_path));
60 60
61 std::string error; 61 std::string error;
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 std::vector<std::string> fallback_locales; 659 std::vector<std::string> fallback_locales;
660 extension_l10n_util::GetAllFallbackLocales("en_US", "all", &fallback_locales); 660 extension_l10n_util::GetAllFallbackLocales("en_US", "all", &fallback_locales);
661 ASSERT_EQ(3U, fallback_locales.size()); 661 ASSERT_EQ(3U, fallback_locales.size());
662 662
663 CHECK_EQ("en_US", fallback_locales[0]); 663 CHECK_EQ("en_US", fallback_locales[0]);
664 CHECK_EQ("en", fallback_locales[1]); 664 CHECK_EQ("en", fallback_locales[1]);
665 CHECK_EQ("all", fallback_locales[2]); 665 CHECK_EQ("all", fallback_locales[2]);
666 } 666 }
667 667
668 } // namespace 668 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_l10n_util.cc ('k') | chrome/common/extensions/manifest_handlers/app_isolation_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698