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

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

Issue 2583763003: Factor out AutocompleteMatch creation from BookmarkProvider (Closed)
Patch Set: TEST_F -> TEST Created 3 years, 11 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: 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..586892e3cd382ba38d3c8963d216d436db526a72 100644
--- a/components/omnibox/browser/bookmark_provider_unittest.cc
+++ b/components/omnibox/browser/bookmark_provider_unittest.cc
@@ -25,6 +25,7 @@
#include "components/omnibox/browser/autocomplete_provider.h"
#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
#include "components/omnibox/browser/test_scheme_classifier.h"
+#include "components/omnibox/browser/titled_url_match_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -422,8 +423,10 @@ 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(
+ bookmark_match, AutocompleteMatchType::BOOKMARK_TITLE, relevance,
+ provider_.get(), classifier_, input, fixed_up_input);
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