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

Unified Diff: chrome/browser/autocomplete/autocomplete_result_unittest.cc

Issue 354773002: Reduces dependency from AutocompleteMatch to Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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/autocomplete/autocomplete_result_unittest.cc
diff --git a/chrome/browser/autocomplete/autocomplete_result_unittest.cc b/chrome/browser/autocomplete/autocomplete_result_unittest.cc
index ac018eb8ab0624c72e7caadd12e6077be66b9208..fb6d09d7e2acfc790b32adeb01055a683d07e174 100644
--- a/chrome/browser/autocomplete/autocomplete_result_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_result_unittest.cc
@@ -186,14 +186,14 @@ void AutocompleteResultTest::RunCopyOldMatchesTest(
PopulateAutocompleteMatches(last, last_size, &last_matches);
AutocompleteResult last_result;
last_result.AppendMatches(last_matches);
- last_result.SortAndCull(input, test_util_.profile());
+ last_result.SortAndCull(input, test_util_.model());
ACMatches current_matches;
PopulateAutocompleteMatches(current, current_size, &current_matches);
AutocompleteResult current_result;
current_result.AppendMatches(current_matches);
- current_result.SortAndCull(input, test_util_.profile());
- current_result.CopyOldMatches(input, last_result, test_util_.profile());
+ current_result.SortAndCull(input, test_util_.model());
+ current_result.CopyOldMatches(input, last_result, test_util_.model());
AssertResultMatches(current_result, expected, expected_size);
}
@@ -219,7 +219,7 @@ TEST_F(AutocompleteResultTest, Swap) {
true, test_util_.profile());
matches.push_back(match);
r1.AppendMatches(matches);
- r1.SortAndCull(input, test_util_.profile());
+ r1.SortAndCull(input, test_util_.model());
EXPECT_EQ(r1.begin(), r1.default_match());
EXPECT_EQ("http://a/", r1.alternate_nav_url().spec());
r1.Swap(&r2);
@@ -300,7 +300,7 @@ TEST_F(AutocompleteResultTest, SortAndCullEmptyDestinationURLs) {
base::string16(), GURL(),
OmniboxEventProto::INVALID_SPEC, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
// Of the two results with the same non-empty destination URL, the
// lower-relevance one should be dropped. All of the results with empty URLs
@@ -346,7 +346,7 @@ TEST_F(AutocompleteResultTest, SortAndCullDuplicateSearchURLs) {
base::string16(), GURL(),
OmniboxEventProto::INVALID_SPEC, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
// We expect the 3rd and 4th results to be removed.
ASSERT_EQ(3U, result.size());
@@ -398,7 +398,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithMatchDups) {
base::string16(), GURL(),
OmniboxEventProto::INVALID_SPEC, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
// Expect 3 unique results after SortAndCull().
ASSERT_EQ(3U, result.size());
@@ -452,7 +452,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDemotionsByType) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
// Check the new ordering. The history-title results should be omitted.
// We cannot check relevance scores because the matches are sorted by
@@ -497,7 +497,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithMatchDupsAndDemotionsByType) {
base::string16(), base::string16::npos, base::string16(), GURL(),
OmniboxEventProto::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS, false,
false, false, true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
// The NAVSUGGEST dup-url stay above search-url since the navsuggest
// variant should not be demoted.
@@ -535,7 +535,7 @@ TEST_F(AutocompleteResultTest, SortAndCullReorderForDefaultMatch) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -551,7 +551,7 @@ TEST_F(AutocompleteResultTest, SortAndCullReorderForDefaultMatch) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
ASSERT_EQ(4U, result.size());
EXPECT_EQ("http://c/", result.match_at(0)->destination_url.spec());
EXPECT_EQ("http://a/", result.match_at(1)->destination_url.spec());
@@ -582,7 +582,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -607,7 +607,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
ASSERT_EQ(4U, result.size());
EXPECT_EQ("http://b/", result.match_at(0)->destination_url.spec());
EXPECT_EQ("http://a/", result.match_at(1)->destination_url.spec());
@@ -628,7 +628,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -644,7 +644,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
ASSERT_EQ(4U, result.size());
EXPECT_EQ("http://c/", result.match_at(0)->destination_url.spec());
EXPECT_EQ("http://a/", result.match_at(1)->destination_url.spec());
@@ -664,7 +664,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
ASSERT_EQ(4U, result.size());
EXPECT_EQ("http://c/", result.match_at(0)->destination_url.spec());
EXPECT_EQ("http://a/", result.match_at(1)->destination_url.spec());
@@ -689,7 +689,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -710,7 +710,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
base::string16(), GURL(),
OmniboxEventProto::HOME_PAGE, false, false, false,
true, test_util_.profile());
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
ASSERT_EQ(4U, result.size());
EXPECT_EQ("http://b/", result.match_at(0)->destination_url.spec());
EXPECT_EQ("http://a/", result.match_at(1)->destination_url.spec());

Powered by Google App Engine
This is Rietveld 408576698