| Index: chrome/browser/autocomplete/search_provider_unittest.cc
|
| diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc
|
| index 90f3872dd03889fd5bafbeeb8a529e4c126514d5..8bf200a433c639fe96169c89e10640a8582c5bd8 100644
|
| --- a/chrome/browser/autocomplete/search_provider_unittest.cc
|
| +++ b/chrome/browser/autocomplete/search_provider_unittest.cc
|
| @@ -26,7 +26,6 @@
|
| #include "chrome/browser/history/history_service.h"
|
| #include "chrome/browser/history/history_service_factory.h"
|
| #include "chrome/browser/omnibox/omnibox_field_trial.h"
|
| -#include "chrome/browser/search/search.h"
|
| #include "chrome/browser/search_engines/search_engine_type.h"
|
| #include "chrome/browser/search_engines/template_url.h"
|
| #include "chrome/browser/search_engines/template_url_service.h"
|
| @@ -1041,138 +1040,163 @@ TEST_F(SearchProviderTest, DefaultFetcherSuggestRelevance) {
|
| const DefaultFetcherMatch kEmptyMatch = { kNotApplicable, false };
|
| struct {
|
| const std::string json;
|
| - const DefaultFetcherMatch matches[4];
|
| + const DefaultFetcherMatch matches[6];
|
| const std::string inline_autocompletion;
|
| } cases[] = {
|
| // Ensure that suggestrelevance scores reorder matches.
|
| { "[\"a\",[\"b\", \"c\"],[],[],{\"google:suggestrelevance\":[1, 2]}]",
|
| - { { "a", true }, { "c", false }, { "b", false }, kEmptyMatch },
|
| + { { "a", true }, { "c", false }, { "b", false }, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\", \"http://c.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1, 2]}]",
|
| - { { "a", true }, { "c.com", false }, { "b.com", false }, kEmptyMatch },
|
| + { { "a", true }, { "c.com", false }, { "b.com", false }, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Without suggested relevance scores, we should only allow one
|
| // navsuggest result to be be displayed.
|
| { "[\"a\",[\"http://b.com\", \"http://c.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"]}]",
|
| - { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that verbatimrelevance scores reorder or suppress verbatim.
|
| // Negative values will have no effect; the calculated value will be used.
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":9999,"
|
| "\"google:suggestrelevance\":[9998]}]",
|
| - { { "a", true}, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true}, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":9998,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":0,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":-1,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":9999,"
|
| "\"google:suggestrelevance\":[9998]}]",
|
| - { { "a", true }, { "a.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":9998,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| ".com" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":0,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| ".com" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":-1,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| ".com" },
|
|
|
| // Ensure that both types of relevance scores reorder matches together.
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[9999, 9997],"
|
| "\"google:verbatimrelevance\":9998}]",
|
| - { { "a1", true }, { "a", true }, { "a2", true }, kEmptyMatch },
|
| + { { "a1", true }, { "a", true }, { "a2", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
|
|
| // Ensure that only inlinable matches may be ranked as the highest result.
|
| // Ignore all suggested relevance scores if this constraint is violated.
|
| { "[\"a\",[\"b\"],[],[],{\"google:suggestrelevance\":[9999]}]",
|
| - { { "a", true }, { "b", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b", false }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"b\"],[],[],{\"google:suggestrelevance\":[9999],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "b", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b", false }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[9999],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"https://a/\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "https://a", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "https://a", true }, { "a", true }, kEmptyMatch, kEmptyMatch,
|
| + 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.
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":1}]",
|
| - { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:suggestrelevance\":[1],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1, 2],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "a2", true }, { "a1", true }, kEmptyMatch },
|
| + { { "a", true }, { "a2", true }, { "a1", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1, 3],"
|
| "\"google:verbatimrelevance\":2}]",
|
| - { { "a", true }, { "a2", true }, { "a1", true }, kEmptyMatch },
|
| + { { "a", true }, { "a2", true }, { "a1", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "a.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1, 2],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "a2.com", true }, { "a1.com", true }, kEmptyMatch },
|
| + { { "a", true }, { "a2.com", true }, { "a1.com", true }, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that all suggestions are considered, regardless of order.
|
| { "[\"a\",[\"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\"],[],[],"
|
| "{\"google:suggestrelevance\":[1, 2, 3, 4, 5, 6, 7]}]",
|
| - { { "a", true }, { "h", false }, { "g", false }, { "f", false } },
|
| + { { "a", true }, { "h", false }, { "g", false }, { "f", false },
|
| + {"e", false }, {"d", false } },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\", \"http://c.com\", \"http://d.com\","
|
| "\"http://e.com\", \"http://f.com\", \"http://g.com\","
|
| @@ -1183,45 +1207,53 @@ TEST_F(SearchProviderTest, DefaultFetcherSuggestRelevance) {
|
| "\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1, 2, 3, 4, 5, 6, 7]}]",
|
| { { "a", true }, { "h.com", false }, { "g.com", false },
|
| - { "f.com", false } },
|
| + { "f.com", false }, {"e.com", false }, {"d.com", false } },
|
| std::string() },
|
|
|
| // Ensure that incorrectly sized suggestion relevance lists are ignored.
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1]}]",
|
| - { { "a", true }, { "a1", true }, { "a2", true }, kEmptyMatch },
|
| + { { "a", true }, { "a1", true }, { "a2", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:suggestrelevance\":[9999, 1]}]",
|
| - { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1]}]",
|
| - { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[9999, 1]}]",
|
| - { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that all 'verbatim' results are merged with their maximum score.
|
| { "[\"a\",[\"a\", \"a1\", \"a2\"],[],[],"
|
| "{\"google:suggestrelevance\":[9998, 9997, 9999]}]",
|
| - { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch },
|
| + { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "2" },
|
| { "[\"a\",[\"a\", \"a1\", \"a2\"],[],[],"
|
| "{\"google:suggestrelevance\":[9998, 9997, 9999],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch },
|
| + { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "2" },
|
|
|
| // Ensure that verbatim is always generated without other suggestions.
|
| // TODO(msw): Ensure verbatimrelevance is respected (except suppression).
|
| { "[\"a\",[],[],[],{\"google:verbatimrelevance\":1}]",
|
| - { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[],[],[],{\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| };
|
|
|
| @@ -1272,133 +1304,157 @@ TEST_F(SearchProviderTest, DefaultFetcherSuggestRelevanceWithReorder) {
|
| const DefaultFetcherMatch kEmptyMatch = { kNotApplicable, false };
|
| struct {
|
| const std::string json;
|
| - const DefaultFetcherMatch matches[4];
|
| + const DefaultFetcherMatch matches[6];
|
| const std::string inline_autocompletion;
|
| } cases[] = {
|
| // Ensure that suggestrelevance scores reorder matches.
|
| { "[\"a\",[\"b\", \"c\"],[],[],{\"google:suggestrelevance\":[1, 2]}]",
|
| - { { "a", true }, { "c", false }, { "b", false }, kEmptyMatch },
|
| + { { "a", true }, { "c", false }, { "b", false }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\", \"http://c.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1, 2]}]",
|
| - { { "a", true }, { "c.com", false }, { "b.com", false }, kEmptyMatch },
|
| + { { "a", true }, { "c.com", false }, { "b.com", false }, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Without suggested relevance scores, we should only allow one
|
| // navsuggest result to be be displayed.
|
| { "[\"a\",[\"http://b.com\", \"http://c.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"]}]",
|
| - { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that verbatimrelevance scores reorder or suppress verbatim.
|
| // Negative values will have no effect; the calculated value will be used.
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":9999,"
|
| "\"google:suggestrelevance\":[9998]}]",
|
| - { { "a", true}, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true}, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":9998,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":0,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":-1,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":9999,"
|
| "\"google:suggestrelevance\":[9998]}]",
|
| - { { "a", true }, { "a.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":9998,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| ".com" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":0,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| ".com" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:verbatimrelevance\":-1,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a.com", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| ".com" },
|
|
|
| // Ensure that both types of relevance scores reorder matches together.
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[9999, 9997],"
|
| "\"google:verbatimrelevance\":9998}]",
|
| - { { "a1", true }, { "a", true }, { "a2", true }, kEmptyMatch },
|
| + { { "a1", true }, { "a", true }, { "a2", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
|
|
| // Allow non-inlineable matches to be the highest-scoring match but,
|
| // if the result set lacks a single inlineable result, abandon suggested
|
| // relevance scores entirely.
|
| { "[\"a\",[\"b\"],[],[],{\"google:suggestrelevance\":[9999]}]",
|
| - { { "b", false }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "b", false }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"b\"],[],[],{\"google:suggestrelevance\":[9999],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "b", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b", false }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| - { { "b.com", false }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "b.com", false }, { "a", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[9999],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "b.com", false }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Allow low-scoring matches.
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":0}]",
|
| - { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":1}]",
|
| - { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:suggestrelevance\":[1],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1, 2],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a2", true }, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a2", true }, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "2" },
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1, 3],"
|
| "\"google:verbatimrelevance\":2}]",
|
| - { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch },
|
| + { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "2" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a.com", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| ".com" },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1, 2],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a2.com", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a2.com", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| "2.com" },
|
|
|
| // Ensure that all suggestions are considered, regardless of order.
|
| { "[\"a\",[\"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\"],[],[],"
|
| "{\"google:suggestrelevance\":[1, 2, 3, 4, 5, 6, 7]}]",
|
| - { { "a", true }, { "h", false }, { "g", false }, { "f", false } },
|
| + { { "a", true }, { "h", false }, { "g", false }, { "f", false },
|
| + { "e", false }, { "d", false } },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\", \"http://c.com\", \"http://d.com\","
|
| "\"http://e.com\", \"http://f.com\", \"http://g.com\","
|
| @@ -1409,45 +1465,53 @@ TEST_F(SearchProviderTest, DefaultFetcherSuggestRelevanceWithReorder) {
|
| "\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1, 2, 3, 4, 5, 6, 7]}]",
|
| { { "a", true }, { "h.com", false }, { "g.com", false },
|
| - { "f.com", false } },
|
| + { "f.com", false }, { "e.com", false }, { "d.com", false } },
|
| std::string() },
|
|
|
| // Ensure that incorrectly sized suggestion relevance lists are ignored.
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1]}]",
|
| - { { "a", true }, { "a1", true }, { "a2", true }, kEmptyMatch },
|
| + { { "a", true }, { "a1", true }, { "a2", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:suggestrelevance\":[9999, 1]}]",
|
| - { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[1]}]",
|
| - { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| "\"google:suggestrelevance\":[9999, 1]}]",
|
| - { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, { "a1.com", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that all 'verbatim' results are merged with their maximum score.
|
| { "[\"a\",[\"a\", \"a1\", \"a2\"],[],[],"
|
| "{\"google:suggestrelevance\":[9998, 9997, 9999]}]",
|
| - { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch },
|
| + { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "2" },
|
| { "[\"a\",[\"a\", \"a1\", \"a2\"],[],[],"
|
| "{\"google:suggestrelevance\":[9998, 9997, 9999],"
|
| "\"google:verbatimrelevance\":0}]",
|
| - { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch },
|
| + { { "a2", true }, { "a", true }, { "a1", true }, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| "2" },
|
|
|
| // Ensure that verbatim is always generated without other suggestions.
|
| // TODO(msw): Ensure verbatimrelevance is respected (except suppression).
|
| { "[\"a\",[],[],[],{\"google:verbatimrelevance\":1}]",
|
| - { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[],[],[],{\"google:verbatimrelevance\":0}]",
|
| - { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + { { "a", true }, kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch,
|
| + kEmptyMatch },
|
| std::string() },
|
| };
|
|
|
| @@ -1509,7 +1573,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| const KeywordFetcherMatch kEmptyMatch = { kNotApplicable, false, false };
|
| struct {
|
| const std::string json;
|
| - const KeywordFetcherMatch matches[5];
|
| + const KeywordFetcherMatch matches[6];
|
| const std::string inline_autocompletion;
|
| } cases[] = {
|
| // Ensure that suggest relevance scores reorder matches and that
|
| @@ -1520,7 +1584,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "k a", false, true },
|
| { "c", true, false },
|
| { "b", true, false },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| // Again, check that relevance scores reorder matches, just this
|
| // time with navigation matches. This also checks that with
|
| @@ -1538,7 +1602,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "d", true, false },
|
| { "c.com", false, false },
|
| { "b.com", false, false },
|
| - { "k a", false, true }, },
|
| + { "k a", false, true },
|
| + kEmptyMatch },
|
| std::string() },
|
|
|
| // Without suggested relevance scores, we should only allow one
|
| @@ -1548,7 +1613,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "b.com", false, false },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that verbatimrelevance scores reorder or suppress verbatim.
|
| @@ -1558,27 +1623,27 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "a1", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":9998,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| { { "a1", true, true },
|
| { "a", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":0,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| { { "a1", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":-1,"
|
| "\"google:suggestrelevance\":[9999]}]",
|
| { { "a1", true, true },
|
| { "a", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| "1" },
|
| { "[\"a\",[\"http://a.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| @@ -1587,7 +1652,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "a.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that both types of relevance scores reorder matches together.
|
| @@ -1597,7 +1662,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a", true, true },
|
| { "a2", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| "1" },
|
|
|
| // Ensure that only inlinable matches may be ranked as the highest result.
|
| @@ -1606,14 +1671,14 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "b", true, false },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"b\"],[],[],{\"google:suggestrelevance\":[9999],"
|
| "\"google:verbatimrelevance\":0}]",
|
| { { "a", true, true },
|
| { "b", true, false },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| @@ -1621,7 +1686,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "b.com", false, false },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| @@ -1630,7 +1695,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "b.com", false, false },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that the top result is ranked as highly as calculated verbatim.
|
| @@ -1641,13 +1706,13 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "a1", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:verbatimrelevance\":1}]",
|
| { { "a", true, true },
|
| { "a1", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| // Continuing the same category of tests, but make sure we keep the
|
| // suggested relevance scores even as we discard the verbatim relevance
|
| @@ -1657,7 +1722,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "k a", false, true },
|
| { "a1", true, true },
|
| - kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1, 2],"
|
| "\"google:verbatimrelevance\":0}]",
|
| @@ -1665,7 +1730,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "k a", false, true },
|
| { "a2", true, true },
|
| { "a1", true, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\", \"a2\"],[],[],{\"google:suggestrelevance\":[1, 3],"
|
| "\"google:verbatimrelevance\":2}]",
|
| @@ -1673,7 +1738,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "k a", false, true },
|
| { "a2", true, true },
|
| { "a1", true, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that all suggestions are considered, regardless of order.
|
| @@ -1683,7 +1748,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "k a", false, true },
|
| { "h", true, false },
|
| { "g", true, false },
|
| - { "f", true, false } },
|
| + { "f", true, false },
|
| + { "e", true, false } },
|
| std::string() },
|
| { "[\"a\",[\"http://b.com\", \"http://c.com\", \"http://d.com\","
|
| "\"http://e.com\", \"http://f.com\", \"http://g.com\","
|
| @@ -1697,7 +1763,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "k a", false, true },
|
| { "h.com", false, false },
|
| { "g.com", false, false },
|
| - { "f.com", false, false } },
|
| + { "f.com", false, false },
|
| + { "e.com", false, false } },
|
| std::string() },
|
|
|
| // Ensure that incorrectly sized suggestion relevance lists are ignored.
|
| @@ -1708,13 +1775,13 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a1", true, true },
|
| { "a2", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"a1\"],[],[],{\"google:suggestrelevance\":[9999, 1]}]",
|
| { { "a", true, true },
|
| { "a1", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| // In this case, ignored the suggested relevance scores means we keep
|
| // only one navsuggest result.
|
| @@ -1724,7 +1791,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "a1.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| @@ -1732,7 +1799,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "a1.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Ensure that all 'verbatim' results are merged with their maximum score.
|
| @@ -1742,7 +1809,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a", true, true },
|
| { "a1", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| "2" },
|
| { "[\"a\",[\"a\", \"a1\", \"a2\"],[],[],"
|
| "{\"google:suggestrelevance\":[9998, 9997, 9999],"
|
| @@ -1751,7 +1818,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a", true, true },
|
| { "a1", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| "2" },
|
|
|
| // Ensure that verbatim is always generated without other suggestions.
|
| @@ -1760,12 +1827,12 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "[\"a\",[],[],[],{\"google:verbatimrelevance\":1}]",
|
| { { "a", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[],[],[],{\"google:verbatimrelevance\":0}]",
|
| { { "a", true, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
|
|
| // Check that navsuggestions will be demoted below queries.
|
| @@ -1781,7 +1848,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a2.com", false, true },
|
| { "a1.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| @@ -1791,7 +1858,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a1.com", false, true },
|
| { "a2.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"https://a/\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\"],"
|
| @@ -1799,8 +1866,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "https://a", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch,
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| // Check when navsuggest scores more than verbatim and there is query
|
| // suggestion but it scores lower.
|
| @@ -1812,7 +1878,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a2.com", false, true },
|
| { "a1.com", false, true },
|
| { "a3", true, true },
|
| - { "k a", false, true } },
|
| + { "k a", false, true },
|
| + kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\", \"a3\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\", \"QUERY\"],"
|
| @@ -1822,7 +1889,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a1.com", false, true },
|
| { "a2.com", false, true },
|
| { "a3", true, true },
|
| - { "k a", false, true } },
|
| + { "k a", false, true },
|
| + kEmptyMatch },
|
| std::string() },
|
| // Check when navsuggest scores more than a query suggestion. There is
|
| // a verbatim but it scores lower.
|
| @@ -1834,7 +1902,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a2.com", false, true },
|
| { "a1.com", false, true },
|
| { "a", true, true },
|
| - { "k a", false, true } },
|
| + { "k a", false, true },
|
| + kEmptyMatch },
|
| "3" },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\", \"a3\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\", \"QUERY\"],"
|
| @@ -1844,7 +1913,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a1.com", false, true },
|
| { "a2.com", false, true },
|
| { "a", true, true },
|
| - { "k a", false, true } },
|
| + { "k a", false, true },
|
| + kEmptyMatch },
|
| "3" },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\", \"a3\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\", \"QUERY\"],"
|
| @@ -1854,7 +1924,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a2.com", false, true },
|
| { "a1.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| "3" },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\", \"a3\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\", \"QUERY\"],"
|
| @@ -1864,7 +1934,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a1.com", false, true },
|
| { "a2.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch },
|
| + kEmptyMatch, kEmptyMatch },
|
| "3" },
|
| // Check when there is neither verbatim nor a query suggestion that,
|
| // because we can't demote navsuggestions below a query suggestion,
|
| @@ -1880,7 +1950,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "a2.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\"],"
|
| @@ -1889,7 +1959,7 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { { "a", true, true },
|
| { "a1.com", false, true },
|
| { "k a", false, true },
|
| - kEmptyMatch, kEmptyMatch},
|
| + kEmptyMatch, kEmptyMatch, kEmptyMatch },
|
| std::string() },
|
| // More checks that everything works when it's not necessary to demote.
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\", \"a3\"],[],[],"
|
| @@ -1900,7 +1970,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a2.com", false, true },
|
| { "a1.com", false, true },
|
| { "a", true, true },
|
| - { "k a", false, true } },
|
| + { "k a", false, true },
|
| + kEmptyMatch },
|
| "3" },
|
| { "[\"a\",[\"http://a1.com\", \"http://a2.com\", \"a3\"],[],[],"
|
| "{\"google:suggesttype\":[\"NAVIGATION\", \"NAVIGATION\", \"QUERY\"],"
|
| @@ -1910,7 +1981,8 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| { "a1.com", false, true },
|
| { "a2.com", false, true },
|
| { "a", true, true },
|
| - { "k a", false, true } },
|
| + { "k a", false, true },
|
| + kEmptyMatch },
|
| "3" },
|
| };
|
|
|
| @@ -1963,10 +2035,6 @@ TEST_F(SearchProviderTest, KeywordFetcherSuggestRelevance) {
|
| }
|
|
|
| TEST_F(SearchProviderTest, LocalAndRemoteRelevances) {
|
| - // Enable Instant Extended in order to allow an increased number of
|
| - // suggestions.
|
| - chrome::EnableInstantExtendedAPIForTesting();
|
| -
|
| // We hardcode the string "term1" below, so ensure that the search term that
|
| // got added to history already is that string.
|
| ASSERT_EQ(ASCIIToUTF16("term1"), term1_);
|
|
|