Commit f9bbbe1a authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Fix crash on unicode characters in PWA names in context menu

Bug: 822144
Change-Id: I810ee10d0f428f8893d90281079341101d7d8c04
Reviewed-on: https://chromium-review.googlesource.com/963956
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544949}
parent 942286d4
...@@ -1135,7 +1135,7 @@ void RenderViewContextMenu::AppendOpenInBookmarkAppLinkItems() { ...@@ -1135,7 +1135,7 @@ void RenderViewContextMenu::AppendOpenInBookmarkAppLinkItems() {
menu_model_.AddItem( menu_model_.AddItem(
IDC_CONTENT_CONTEXT_OPENLINKBOOKMARKAPP, IDC_CONTENT_CONTEXT_OPENLINKBOOKMARKAPP,
l10n_util::GetStringFUTF16(open_in_app_string_id, l10n_util::GetStringFUTF16(open_in_app_string_id,
base::ASCIIToUTF16(pwa->short_name()))); base::UTF8ToUTF16(pwa->short_name())));
MenuManager* menu_manager = MenuManager::Get(browser_context_); MenuManager* menu_manager = MenuManager::Get(browser_context_);
gfx::Image icon = menu_manager->GetIconForExtension(pwa->id()); gfx::Image icon = menu_manager->GetIconForExtension(pwa->id());
......
...@@ -176,8 +176,9 @@ class ContextMenuBrowserTest : public InProcessBrowserTest { ...@@ -176,8 +176,9 @@ class ContextMenuBrowserTest : public InProcessBrowserTest {
WebApplicationInfo web_app_info; WebApplicationInfo web_app_info;
web_app_info.app_url = app_url; web_app_info.app_url = app_url;
web_app_info.scope = app_url; web_app_info.scope = app_url;
web_app_info.title = base::UTF8ToUTF16("Test app"); web_app_info.title = base::UTF8ToUTF16("Test app \xF0\x9F\x90\x90");
web_app_info.description = base::UTF8ToUTF16("Test description"); web_app_info.description =
base::UTF8ToUTF16("Test description \xF0\x9F\x90\x90");
web_app_info.open_as_window = open_as_window; web_app_info.open_as_window = open_as_window;
return extensions::browsertest_util::InstallBookmarkApp( return extensions::browsertest_util::InstallBookmarkApp(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment