| 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_);
|
|
|