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

Unified Diff: chrome/browser/extensions/extension_l10n_util_unittest.cc

Issue 196029: Simple fix of extension_l10n_util that allows folders in form ".some_name" to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_l10n_util_unittest.cc
===================================================================
--- chrome/browser/extensions/extension_l10n_util_unittest.cc (revision 25456)
+++ chrome/browser/extensions/extension_l10n_util_unittest.cc (working copy)
@@ -6,9 +6,11 @@
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/path_service.h"
#include "base/scoped_ptr.h"
#include "base/scoped_temp_dir.h"
#include "base/values.h"
+#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,7 +19,30 @@
namespace {
- Extension* CreateMinimalExtension(const std::string& default_locale) {
+TEST(ExtensionL10nUtil, LoadGoodExtensionFromSVNTree) {
+ FilePath install_dir;
+ ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &install_dir));
+ install_dir = install_dir.AppendASCII("extensions")
+ .AppendASCII("good")
+ .AppendASCII("Extensions")
+ .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj")
+ .AppendASCII("1.0.0.0");
+
+ FilePath locale_path = install_dir.AppendASCII(Extension::kLocaleFolder);
+ ASSERT_TRUE(file_util::PathExists(locale_path));
+
+ scoped_ptr<Extension> extension(new Extension(install_dir));
+ std::string error;
+ EXPECT_TRUE(extension_l10n_util::AddValidLocales(
+ locale_path, extension.get(), &error));
+ const std::set<std::string>& supported_locales =
+ extension->supported_locales();
+ EXPECT_EQ(2U, supported_locales.size());
+ EXPECT_TRUE(supported_locales.find("en-US") != supported_locales.end());
+ EXPECT_TRUE(supported_locales.find("sr") != supported_locales.end());
+}
+
+Extension* CreateMinimalExtension(const std::string& default_locale) {
#if defined(OS_WIN)
FilePath path(FILE_PATH_LITERAL("C:\\foo"));
#elif defined(OS_POSIX)

Powered by Google App Engine
This is Rietveld 408576698