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

Unified Diff: chrome/browser/autocomplete/search_provider_unittest.cc

Issue 23619016: Switch the offset conversion routines from... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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/autocomplete/search_provider_unittest.cc
===================================================================
--- chrome/browser/autocomplete/search_provider_unittest.cc (revision 222128)
+++ chrome/browser/autocomplete/search_provider_unittest.cc (working copy)
@@ -1003,6 +1003,11 @@
"\"google:verbatimrelevance\":0}]",
{ { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch },
std::string() },
+ { "[\"a\",[\"https://a/\"],[],[],"
+ "{\"google:suggesttype\":[\"NAVIGATION\"],"
+ "\"google:suggestrelevance\":[9999]}]",
+ { { "https://a", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
+ std::string() },
// Ensure that the top result is ranked as highly as calculated verbatim.
// Ignore the suggested verbatim relevance if this constraint is violated.
@@ -1661,6 +1666,15 @@
{ "k a", false, true },
kEmptyMatch },
std::string() },
+ { "[\"a\",[\"https://a/\"],[],[],"
+ "{\"google:suggesttype\":[\"NAVIGATION\"],"
+ "\"google:suggestrelevance\":[9999]}]",
+ { { "a", true, true },
+ { "https://a", false, true },
+ { "k a", false, true },
+ kEmptyMatch,
+ kEmptyMatch },
+ std::string() },
// Check when navsuggest scores more than verbatim and there is query
// suggestion but it scores lower.
{ "[\"a\",[\"http://a1.com\", \"http://a2.com\", \"a3\"],[],[],"
@@ -1949,6 +1963,12 @@
{ { "a.com/a", AutocompleteMatchType::NAVSUGGEST, true },
{ "a.com", AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, true },
kEmptyMatch, kEmptyMatch } },
+ { "a.com", "[\"a.com\",[\"https://a.com\"],[],[],"
+ "{\"google:suggesttype\":[\"NAVIGATION\"],"
+ "\"google:suggestrelevance\":[9999]}]",
+ { { "https://a.com", AutocompleteMatchType::NAVSUGGEST, true },
+ { "a.com", AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED, true },
+ kEmptyMatch, kEmptyMatch } },
// Ensure topmost SUGGEST matches are not allowed for URL input.
// SearchProvider disregards search and verbatim suggested relevances.
@@ -2124,11 +2144,12 @@
{ "ftp://www.a", "ftp://a.com",
"ftp://a.com", std::string(), false },
- // Input matching but with nothing to inline will not yield an offset.
+ // Input matching but with nothing to inline will not yield an offset, but
+ // will be allowed to be default.
{ "abc.com", "http://www.abc.com",
- "www.abc.com", std::string(), false },
+ "www.abc.com", std::string(), true },
{ "http://www.abc.com", "http://www.abc.com",
- "http://www.abc.com", std::string(), false },
+ "http://www.abc.com", std::string(), true },
// Inline matches when the input is a leading substring of the scheme.
{ "h", "http://www.abc.com",

Powered by Google App Engine
This is Rietveld 408576698