| Index: chrome/browser/autocomplete/shortcuts_provider_unittest.cc
|
| ===================================================================
|
| --- chrome/browser/autocomplete/shortcuts_provider_unittest.cc (revision 257281)
|
| +++ chrome/browser/autocomplete/shortcuts_provider_unittest.cc (working copy)
|
| @@ -22,11 +22,11 @@
|
| #include "chrome/browser/autocomplete/autocomplete_provider.h"
|
| #include "chrome/browser/autocomplete/autocomplete_provider_listener.h"
|
| #include "chrome/browser/autocomplete/autocomplete_result.h"
|
| +#include "chrome/browser/autocomplete/shortcuts_backend.h"
|
| +#include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
|
| #include "chrome/browser/chrome_notification_types.h"
|
| #include "chrome/browser/history/history_service.h"
|
| #include "chrome/browser/history/in_memory_url_index.h"
|
| -#include "chrome/browser/history/shortcuts_backend.h"
|
| -#include "chrome/browser/history/shortcuts_backend_factory.h"
|
| #include "chrome/browser/history/url_database.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| @@ -211,9 +211,7 @@
|
| ShortcutsProvider::CreateWordMapForString(find_text), text_, matches_);
|
| }
|
|
|
| -namespace history {
|
|
|
| -
|
| // ShortcutsProviderTest ------------------------------------------------------
|
|
|
| class ShortcutsProviderTest : public testing::Test,
|
| @@ -263,7 +261,7 @@
|
|
|
| // Passthrough to the private function in provider_.
|
| int CalculateScore(const std::string& terms,
|
| - const ShortcutsBackend::Shortcut& shortcut,
|
| + const history::ShortcutsDatabase::Shortcut& shortcut,
|
| int max_relevance);
|
|
|
| base::MessageLoopForUI message_loop_;
|
| @@ -307,14 +305,12 @@
|
| size_t expected_size = backend_->shortcuts_map().size() + db_size;
|
| for (size_t i = 0; i < db_size; ++i) {
|
| const TestShortcutInfo& cur = db[i];
|
| - ShortcutsBackend::Shortcut shortcut(
|
| + history::ShortcutsDatabase::Shortcut shortcut(
|
| cur.guid, ASCIIToUTF16(cur.text),
|
| - ShortcutsBackend::Shortcut::MatchCore(
|
| + history::ShortcutsDatabase::Shortcut::MatchCore(
|
| ASCIIToUTF16(cur.fill_into_edit), GURL(cur.destination_url),
|
| - ASCIIToUTF16(cur.contents),
|
| - AutocompleteMatch::ClassificationsFromString(cur.contents_class),
|
| - ASCIIToUTF16(cur.description),
|
| - AutocompleteMatch::ClassificationsFromString(cur.description_class),
|
| + ASCIIToUTF16(cur.contents), cur.contents_class,
|
| + ASCIIToUTF16(cur.description), cur.description_class,
|
| cur.transition, cur.type, ASCIIToUTF16(cur.keyword)),
|
| base::Time::Now() - base::TimeDelta::FromDays(cur.days_from_now),
|
| cur.number_of_hits);
|
| @@ -378,7 +374,7 @@
|
|
|
| int ShortcutsProviderTest::CalculateScore(
|
| const std::string& terms,
|
| - const ShortcutsBackend::Shortcut& shortcut,
|
| + const history::ShortcutsDatabase::Shortcut& shortcut,
|
| int max_relevance) {
|
| return provider_->CalculateScore(ASCIIToUTF16(terms), shortcut,
|
| max_relevance);
|
| @@ -650,16 +646,13 @@
|
| }
|
|
|
| TEST_F(ShortcutsProviderTest, CalculateScore) {
|
| - ShortcutsBackend::Shortcut shortcut(
|
| + history::ShortcutsDatabase::Shortcut shortcut(
|
| std::string(), ASCIIToUTF16("test"),
|
| - ShortcutsBackend::Shortcut::MatchCore(
|
| + history::ShortcutsDatabase::Shortcut::MatchCore(
|
| ASCIIToUTF16("www.test.com"), GURL("http://www.test.com"),
|
| - ASCIIToUTF16("www.test.com"),
|
| - AutocompleteMatch::ClassificationsFromString("0,1,4,3,8,1"),
|
| - ASCIIToUTF16("A test"),
|
| - AutocompleteMatch::ClassificationsFromString("0,0,2,2"),
|
| - content::PAGE_TRANSITION_TYPED, AutocompleteMatchType::HISTORY_URL,
|
| - base::string16()),
|
| + ASCIIToUTF16("www.test.com"), "0,1,4,3,8,1",
|
| + ASCIIToUTF16("A test"), "0,0,2,2", content::PAGE_TRANSITION_TYPED,
|
| + AutocompleteMatchType::HISTORY_URL, base::string16()),
|
| base::Time::Now(), 1);
|
|
|
| // Maximal score.
|
| @@ -790,5 +783,3 @@
|
| // Now the URL should have disappeared.
|
| RunTest(text, false, ExpectedURLs(), std::string(), base::string16());
|
| }
|
| -
|
| -} // namespace history
|
|
|