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

Unified Diff: components/omnibox/browser/keyword_provider_unittest.cc

Issue 1784233003: Omnibox - Keyword Provider Shouldn't Bold What-You-Typed Queries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: put <> around text Created 4 years, 8 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
« no previous file with comments | « components/omnibox/browser/keyword_provider.cc ('k') | components/omnibox_strings.grdp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/keyword_provider_unittest.cc
diff --git a/components/omnibox/browser/keyword_provider_unittest.cc b/components/omnibox/browser/keyword_provider_unittest.cc
index c0476a5b30a18b08941db5e5d6e6a58765c282d0..95c913d1934f9e119db103bfa90d51413e347575 100644
--- a/components/omnibox/browser/keyword_provider_unittest.cc
+++ b/components/omnibox/browser/keyword_provider_unittest.cc
@@ -376,12 +376,12 @@ TEST_F(KeywordProviderTest, URL) {
TEST_F(KeywordProviderTest, Contents) {
const MatchType<base::string16> kEmptyMatch = { base::string16(), false };
TestData<base::string16> contents_cases[] = {
- // No query input -> substitute "<enter query>" into contents.
+ // No query input -> substitute "<Type search term>" into contents.
{ ASCIIToUTF16("z"), 1,
- { { ASCIIToUTF16("Search z for <enter query>"), true },
+ { { ASCIIToUTF16("<Type search term>"), true },
kEmptyMatch, kEmptyMatch } },
{ ASCIIToUTF16("z \t"), 1,
- { { ASCIIToUTF16("Search z for <enter query>"), true },
+ { { ASCIIToUTF16("<Type search term>"), true },
kEmptyMatch, kEmptyMatch } },
// Exact keyword matches with remaining text should return nothing.
@@ -395,21 +395,25 @@ TEST_F(KeywordProviderTest, Contents) {
// chrome/browser/extensions/api/omnibox/omnibox_apitest.cc's
// in OmniboxApiTest's Basic test.
- // Substitution should work with various locations of the "%s".
+ // There are two keywords that start with "aaa". Suggestions will be
+ // disambiguated by the description. We do not test the description value
+ // here because KeywordProvider doesn't set descriptions; these are
+ // populated later by AutocompleteController.
{ ASCIIToUTF16("aaa"), 2,
- { { ASCIIToUTF16("Search aaaa for <enter query>"), false },
- { ASCIIToUTF16("Search aaaaa for <enter query>"), false },
+ { { ASCIIToUTF16("<Type search term>"), false },
+ { ASCIIToUTF16("<Type search term>"), false },
kEmptyMatch} },
+ // When there is a search string, simply display it.
{ ASCIIToUTF16("www.w w"), 2,
- { { ASCIIToUTF16("Search www for w"), false },
- { ASCIIToUTF16("Search weasel for w"), false },
+ { { ASCIIToUTF16("w"), false },
+ { ASCIIToUTF16("w"), false },
kEmptyMatch } },
// Also, check that tokenization only collapses whitespace between first
// tokens and contents are not escaped or unescaped.
{ ASCIIToUTF16("a 1 2+ 3"), 3,
- { { ASCIIToUTF16("Search aa for 1 2+ 3"), false },
- { ASCIIToUTF16("Search ab for 1 2+ 3"), false },
- { ASCIIToUTF16("Search aaaa for 1 2+ 3"), false } } },
+ { { ASCIIToUTF16("1 2+ 3"), false },
+ { ASCIIToUTF16("1 2+ 3"), false },
+ { ASCIIToUTF16("1 2+ 3"), false } } },
};
SetUpClientAndKeywordProvider();
« no previous file with comments | « components/omnibox/browser/keyword_provider.cc ('k') | components/omnibox_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698