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

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 6dd6e6207284132f359a9d92f65b9f7ebdb14ed0..312a890d798e8e38a3039ae49d434310d3ba419a 100644
--- a/chrome/browser/autocomplete/autocomplete_result_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_result_unittest.cc
@@ -189,14 +189,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);
}
@@ -223,7 +223,7 @@ TEST_F(AutocompleteResultTest, Swap) {
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);
@@ -306,7 +306,7 @@ TEST_F(AutocompleteResultTest, SortAndCullEmptyDestinationURLs) {
true,
ChromeAutocompleteSchemeClassifier(
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
@@ -354,7 +354,7 @@ TEST_F(AutocompleteResultTest, SortAndCullDuplicateSearchURLs) {
true,
ChromeAutocompleteSchemeClassifier(
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());
@@ -408,7 +408,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithMatchDups) {
true,
ChromeAutocompleteSchemeClassifier(
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());
@@ -464,7 +464,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDemotionsByType) {
true,
ChromeAutocompleteSchemeClassifier(
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
@@ -510,7 +510,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithMatchDupsAndDemotionsByType) {
OmniboxEventProto::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS, false,
false, false, true,
ChromeAutocompleteSchemeClassifier(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.
@@ -550,7 +550,7 @@ TEST_F(AutocompleteResultTest, SortAndCullReorderForDefaultMatch) {
true,
ChromeAutocompleteSchemeClassifier(
test_util_.profile()));
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -568,7 +568,7 @@ TEST_F(AutocompleteResultTest, SortAndCullReorderForDefaultMatch) {
true,
ChromeAutocompleteSchemeClassifier(
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());
@@ -601,7 +601,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
true,
ChromeAutocompleteSchemeClassifier(
test_util_.profile()));
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -628,7 +628,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
true,
ChromeAutocompleteSchemeClassifier(
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());
@@ -651,7 +651,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
true,
ChromeAutocompleteSchemeClassifier(
test_util_.profile()));
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -669,7 +669,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
true,
ChromeAutocompleteSchemeClassifier(
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());
@@ -691,7 +691,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
true,
ChromeAutocompleteSchemeClassifier(
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());
@@ -718,7 +718,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
true,
ChromeAutocompleteSchemeClassifier(
test_util_.profile()));
- result.SortAndCull(input, test_util_.profile());
+ result.SortAndCull(input, test_util_.model());
AssertResultMatches(result, data, 4);
}
@@ -741,7 +741,7 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDisableInlining) {
true,
ChromeAutocompleteSchemeClassifier(
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());
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_result.cc ('k') | chrome/browser/autocomplete/base_search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698