| Index: chrome/common/extensions/extension_l10n_util_unittest.cc
|
| diff --git a/chrome/common/extensions/extension_l10n_util_unittest.cc b/chrome/common/extensions/extension_l10n_util_unittest.cc
|
| index 52aabd563e2be160d8abab6ed5d6eee8e76666d2..783ddb48e817cb8a5c0ffaf0be8a7fad934f2368 100644
|
| --- a/chrome/common/extensions/extension_l10n_util_unittest.cc
|
| +++ b/chrome/common/extensions/extension_l10n_util_unittest.cc
|
| @@ -281,6 +281,14 @@ ExtensionMessageBundle* CreateManifestBundle() {
|
| file_handler_title_tree->SetString("message", "file handler title");
|
| catalog->Set("file_handler_title", file_handler_title_tree);
|
|
|
| + DictionaryValue* launch_local_path_tree = new DictionaryValue();
|
| + launch_local_path_tree->SetString("message", "main.html");
|
| + catalog->Set("launch_local_path", launch_local_path_tree);
|
| +
|
| + DictionaryValue* launch_web_url_tree = new DictionaryValue();
|
| + launch_web_url_tree->SetString("message", "http://www.google.com/");
|
| + catalog->Set("launch_web_url", launch_web_url_tree);
|
| +
|
| std::vector<linked_ptr<DictionaryValue> > catalogs;
|
| catalogs.push_back(catalog);
|
|
|
| @@ -339,6 +347,40 @@ TEST(ExtensionL10nUtil, LocalizeManifestWithNameMsgAndEmptyDescription) {
|
| EXPECT_TRUE(error.empty());
|
| }
|
|
|
| +TEST(ExtensionL10nUtil, LocalizeManifestWithLocalLaunchURL) {
|
| + DictionaryValue manifest;
|
| + manifest.SetString(keys::kName, "name");
|
| + manifest.SetString(keys::kLaunchLocalPath, "__MSG_launch_local_path__");
|
| + std::string error;
|
| + scoped_ptr<ExtensionMessageBundle> messages(CreateManifestBundle());
|
| +
|
| + EXPECT_TRUE(
|
| + extension_l10n_util::LocalizeManifest(*messages, &manifest, &error));
|
| +
|
| + std::string result;
|
| + ASSERT_TRUE(manifest.GetString(keys::kLaunchLocalPath, &result));
|
| + EXPECT_EQ("main.html", result);
|
| +
|
| + EXPECT_TRUE(error.empty());
|
| +}
|
| +
|
| +TEST(ExtensionL10nUtil, LocalizeManifestWithHostedLaunchURL) {
|
| + DictionaryValue manifest;
|
| + manifest.SetString(keys::kName, "name");
|
| + manifest.SetString(keys::kLaunchWebURL, "__MSG_launch_web_url__");
|
| + std::string error;
|
| + scoped_ptr<ExtensionMessageBundle> messages(CreateManifestBundle());
|
| +
|
| + EXPECT_TRUE(
|
| + extension_l10n_util::LocalizeManifest(*messages, &manifest, &error));
|
| +
|
| + std::string result;
|
| + ASSERT_TRUE(manifest.GetString(keys::kLaunchWebURL, &result));
|
| + EXPECT_EQ("http://www.google.com/", result);
|
| +
|
| + EXPECT_TRUE(error.empty());
|
| +}
|
| +
|
| TEST(ExtensionL10nUtil, LocalizeManifestWithBadNameMsg) {
|
| DictionaryValue manifest;
|
| manifest.SetString(keys::kName, "__MSG_name_is_bad__");
|
|
|