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

Unified Diff: chrome/browser/history/shortcuts_backend_unittest.cc

Issue 165163002: Handle Search suggest subtypes for Shortcuts DB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: With unittest Created 6 years, 10 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/history/shortcuts_backend_unittest.cc
diff --git a/chrome/browser/history/shortcuts_backend_unittest.cc b/chrome/browser/history/shortcuts_backend_unittest.cc
index 8bd0eecd7bc0a4c425b57e9797102963fadc389b..65a66d40a0707e115df6c46c9d43f1cd088d0b58 100644
--- a/chrome/browser/history/shortcuts_backend_unittest.cc
+++ b/chrome/browser/history/shortcuts_backend_unittest.cc
@@ -122,6 +122,14 @@ TEST_F(ShortcutsBackendTest, ChangeMatchTypeOnShortcutCreation) {
AutocompleteMatchType::SEARCH_HISTORY },
{ AutocompleteMatchType::SEARCH_SUGGEST,
AutocompleteMatchType::SEARCH_HISTORY },
+ { AutocompleteMatchType::SEARCH_SUGGEST_ENTITY,
+ AutocompleteMatchType::SEARCH_HISTORY },
+ { AutocompleteMatchType::SEARCH_SUGGEST_INFINITE,
+ AutocompleteMatchType::SEARCH_HISTORY },
+ { AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED,
+ AutocompleteMatchType::SEARCH_HISTORY },
+ { AutocompleteMatchType::SEARCH_SUGGEST_PROFILE,
+ AutocompleteMatchType::SEARCH_HISTORY },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(type_cases); ++i) {
@@ -130,6 +138,29 @@ TEST_F(ShortcutsBackendTest, ChangeMatchTypeOnShortcutCreation) {
}
}
+TEST_F(ShortcutsBackendTest, EntitySuggestionTest) {
+ AutocompleteMatch match;
+ match.fill_into_edit = base::UTF8ToUTF16("franklin d roosevelt");
+ match.type = AutocompleteMatchType::SEARCH_SUGGEST_ENTITY;
+ match.contents = base::UTF8ToUTF16("roosevelt");
+ match.contents_class =
+ AutocompleteMatch::ClassificationsFromString("0,0,5,2");
+ match.description = base::UTF8ToUTF16("Franklin D. Roosevelt");
+ match.description_class = AutocompleteMatch::ClassificationsFromString("0,4");
+ match.destination_url = GURL(
+ "http://www.google.com/search?q=franklin+d+roosevelt&gs_ssp=1234");
+ match.stripped_destination_url = GURL(
+ "http://www.google.com/search?q=franklin+d+roosevelt");
+
+ ShortcutsBackend::Shortcut::MatchCore match_core(match);
+
+ EXPECT_EQ(match.stripped_destination_url, match_core.destination_url);
+ EXPECT_EQ(match.fill_into_edit, match_core.contents);
+ EXPECT_TRUE(match_core.contents_class.empty());
+ EXPECT_EQ(base::string16(), match_core.description);
+ EXPECT_TRUE(match_core.description_class.empty());
+}
+
TEST_F(ShortcutsBackendTest, AddAndUpdateShortcut) {
InitBackend();
EXPECT_FALSE(changed_notified_);
« chrome/browser/history/shortcuts_backend.cc ('K') | « chrome/browser/history/shortcuts_backend.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698