0

Open tab search url delimiter should not be elided.

Bug: 1329356
Change-Id: I124590ddb5c6e5ffe831876ecea808bc64954c2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3669741
Reviewed-by: Rachel Wong <wrong@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1008514}
This commit is contained in:
Yulun Wu
2022-05-28 01:08:38 +00:00
committed by Chromium LUCI CQ
parent c2a606feb0
commit 11e1185af8
4 changed files with 16 additions and 16 deletions

@ -4772,7 +4772,7 @@ New install
Opened yesterday
</message>
<message name="IDS_APP_LIST_OPEN_TAB_HINT" desc="Shown alongside launcher search results which will take the user to an open tab when clicked.">
Go to this tab
<ph name="delimiter">$1<ex> - </ex></ph> Go to this tab
</message>
<message name="IDS_APP_LIST_SEARCH_GAME_PLATFORMS_PREFIX" desc="Shown next to a video game search result, begins a list of cloud gaming platforms the game is playable on.">
on

@ -1 +1 @@
01c6ebfd07de5c34e9ff559823396ef011e8b777
35b10699f3dfd788c8669c4596d5c2f43207d02d

@ -104,15 +104,15 @@ void OpenTabResult::UpdateText() {
std::u16string url = base::UTF8ToUTF16(match_.destination_url.spec());
SetDetailsTextVector(
{CreateStringTextItem(url).SetTextTags({Tag(Tag::URL, 0, url.length())}),
CreateStringTextItem(kUrlDelimiter),
CreateStringTextItem(IDS_APP_LIST_OPEN_TAB_HINT)
CreateStringTextItem(l10n_util::GetStringFUTF16(
IDS_APP_LIST_OPEN_TAB_HINT, kUrlDelimiter))
.SetOverflowBehavior(
ash::SearchResultTextItem::OverflowBehavior::kNoElide)});
SetAccessibleName(
base::JoinString({match_.description, url,
l10n_util::GetStringUTF16(IDS_APP_LIST_OPEN_TAB_HINT)},
kA11yDelimiter));
SetAccessibleName(base::JoinString(
{match_.description, url,
l10n_util::GetStringFUTF16(IDS_APP_LIST_OPEN_TAB_HINT, u"")},
kA11yDelimiter));
}
void OpenTabResult::UpdateIcon() {

@ -49,14 +49,14 @@ TEST_F(OpenTabResultTest, Basic) {
MakeResult(u"query", u"queryabc", u"http://www.website.com");
EXPECT_EQ(result->title(), u"queryabc");
EXPECT_EQ(
StringFromTextVector(result->details_text_vector()),
base::StrCat({u"http://www.website.com/ - ",
l10n_util::GetStringUTF16(IDS_APP_LIST_OPEN_TAB_HINT)}));
EXPECT_EQ(
result->accessible_name(),
base::StrCat({u"queryabc, http://www.website.com/, ",
l10n_util::GetStringUTF16(IDS_APP_LIST_OPEN_TAB_HINT)}));
EXPECT_EQ(StringFromTextVector(result->details_text_vector()),
base::StrCat({u"http://www.website.com/",
l10n_util::GetStringFUTF16(IDS_APP_LIST_OPEN_TAB_HINT,
u" - ")}));
EXPECT_EQ(result->accessible_name(),
base::StrCat({u"queryabc, http://www.website.com/",
l10n_util::GetStringFUTF16(IDS_APP_LIST_OPEN_TAB_HINT,
u", ")}));
}
TEST_F(OpenTabResultTest, ManuallyCalculateRelevance) {