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

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

Issue 2583763003: Factor out AutocompleteMatch creation from BookmarkProvider (Closed)
Patch Set: add unit test Created 4 years 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: components/omnibox/browser/bookmark_provider_unittest.cc
diff --git a/components/omnibox/browser/bookmark_provider_unittest.cc b/components/omnibox/browser/bookmark_provider_unittest.cc
index 277f3c38beb927679b2c440529a0188d16e9e61b..40af9141250b87f42cd06495304b18173bd1ad84 100644
--- a/components/omnibox/browser/bookmark_provider_unittest.cc
+++ b/components/omnibox/browser/bookmark_provider_unittest.cc
@@ -23,6 +23,7 @@
#include "components/bookmarks/test/test_bookmark_client.h"
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/omnibox/browser/autocomplete_provider.h"
+#include "components/omnibox/browser/autocomplete_provider_utils.h"
#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -422,8 +423,11 @@ TEST_F(BookmarkProviderTest, InlineAutocompletion) {
node.SetTitle(base::ASCIIToUTF16(query_data[i].url));
TitledUrlMatch bookmark_match;
bookmark_match.node = &node;
- const AutocompleteMatch& ac_match = provider_->TitledUrlMatchToACMatch(
- input, fixed_up_input, bookmark_match);
+ int relevance = provider_->CalculateBookmarkMatchRelevance(bookmark_match);
+ const AutocompleteMatch& ac_match =
+ TitledUrlMatchToAutocompleteMatch(
+ provider_.get(), classifier_, input, fixed_up_input, bookmark_match,
+ AutocompleteMatchType::BOOKMARK_TITLE, relevance);
EXPECT_EQ(query_data[i].allowed_to_be_default_match,
ac_match.allowed_to_be_default_match) << description;
EXPECT_EQ(base::ASCIIToUTF16(query_data[i].inline_autocompletion),

Powered by Google App Engine
This is Rietveld 408576698