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

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

Issue 11414303: Make Google Search autocomplete provider cursor aware. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years 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/history_contents_provider_unittest.cc
diff --git a/chrome/browser/autocomplete/history_contents_provider_unittest.cc b/chrome/browser/autocomplete/history_contents_provider_unittest.cc
index 99aad04371a7fb2f70a7edf270e8225cd797e4c6..0d86def118a9abbbe86069b2ca660144b307f45b 100644
--- a/chrome/browser/autocomplete/history_contents_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_contents_provider_unittest.cc
@@ -120,8 +120,8 @@ class HistoryContentsProviderBodyOnlyTest : public HistoryContentsProviderTest {
};
TEST_F(HistoryContentsProviderTest, Body) {
- AutocompleteInput input(ASCIIToUTF16("FOO"), string16(), true, false, true,
- AutocompleteInput::ALL_MATCHES);
+ AutocompleteInput input(ASCIIToUTF16("FOO"), string16::npos, string16(), true,
+ false, true, AutocompleteInput::ALL_MATCHES);
RunQuery(input, false);
// The results should be the first two pages, in decreasing order.
@@ -134,8 +134,8 @@ TEST_F(HistoryContentsProviderTest, Body) {
}
TEST_F(HistoryContentsProviderTest, Title) {
- AutocompleteInput input(ASCIIToUTF16("PAGEONE"), string16(), true, false,
- true, AutocompleteInput::ALL_MATCHES);
+ AutocompleteInput input(ASCIIToUTF16("PAGEONE"), string16::npos, string16(),
+ true, false, true, AutocompleteInput::ALL_MATCHES);
RunQuery(input, false);
// The results should be the first two pages.
@@ -151,15 +151,17 @@ TEST_F(HistoryContentsProviderTest, Title) {
TEST_F(HistoryContentsProviderTest, MinimalChanges) {
// A minimal changes request when there have been no real queries should
// give us no results.
- AutocompleteInput sync_input(ASCIIToUTF16("PAGEONE"), string16(), true, false,
- true, AutocompleteInput::SYNCHRONOUS_MATCHES);
+ AutocompleteInput sync_input(ASCIIToUTF16("PAGEONE"), string16::npos,
+ string16(), true, false, true,
+ AutocompleteInput::SYNCHRONOUS_MATCHES);
RunQuery(sync_input, true);
const ACMatches& m1 = matches();
EXPECT_EQ(0U, m1.size());
// Now do a "regular" query to get the results.
- AutocompleteInput async_input(ASCIIToUTF16("PAGEONE"), string16(), true,
- false, true, AutocompleteInput::ALL_MATCHES);
+ AutocompleteInput async_input(ASCIIToUTF16("PAGEONE"), string16::npos,
+ string16(), true, false, true,
+ AutocompleteInput::ALL_MATCHES);
RunQuery(async_input, false);
const ACMatches& m2 = matches();
EXPECT_EQ(2U, m2.size());
@@ -174,15 +176,17 @@ TEST_F(HistoryContentsProviderTest, MinimalChanges) {
TEST_F(HistoryContentsProviderBodyOnlyTest, MinimalChanges) {
// A minimal changes request when there have been no real queries should
// give us no results.
- AutocompleteInput sync_input(ASCIIToUTF16("PAGEONE"), string16(), true, false,
- true, AutocompleteInput::SYNCHRONOUS_MATCHES);
+ AutocompleteInput sync_input(ASCIIToUTF16("PAGEONE"), string16::npos,
+ string16(), true, false, true,
+ AutocompleteInput::SYNCHRONOUS_MATCHES);
RunQuery(sync_input, true);
const ACMatches& m1 = matches();
EXPECT_EQ(0U, m1.size());
// Now do a "regular" query to get no results because we are body-only.
- AutocompleteInput async_input(ASCIIToUTF16("PAGEONE"), string16(), true,
- false, true, AutocompleteInput::ALL_MATCHES);
+ AutocompleteInput async_input(ASCIIToUTF16("PAGEONE"), string16::npos,
+ string16(), true, false, true,
+ AutocompleteInput::ALL_MATCHES);
RunQuery(async_input, false);
const ACMatches& m2 = matches();
EXPECT_EQ(0U, m2.size());
@@ -196,8 +200,8 @@ TEST_F(HistoryContentsProviderBodyOnlyTest, MinimalChanges) {
// Tests that history is deleted properly.
TEST_F(HistoryContentsProviderTest, DeleteMatch) {
- AutocompleteInput input(ASCIIToUTF16("bar"), string16(), true, false, true,
- AutocompleteInput::ALL_MATCHES);
+ AutocompleteInput input(ASCIIToUTF16("bar"), string16::npos, string16(), true,
+ false, true, AutocompleteInput::ALL_MATCHES);
RunQuery(input, false);
// Query; the result should be the third page.
@@ -223,8 +227,8 @@ TEST_F(HistoryContentsProviderTest, DeleteStarredMatch) {
ASCIIToUTF16("bar"));
// Get the match to delete its history
- AutocompleteInput input(ASCIIToUTF16("bar"), string16(), true, false, true,
- AutocompleteInput::ALL_MATCHES);
+ AutocompleteInput input(ASCIIToUTF16("bar"), string16::npos, string16(), true,
+ false, true, AutocompleteInput::ALL_MATCHES);
RunQuery(input, false);
const ACMatches& m = matches();
ASSERT_EQ(1U, m.size());
@@ -234,8 +238,9 @@ TEST_F(HistoryContentsProviderTest, DeleteStarredMatch) {
EXPECT_EQ(1U, matches().size());
// Run a query that would only match history (but the history is deleted)
- AutocompleteInput you_input(ASCIIToUTF16("you"), string16(), true, false,
- true, AutocompleteInput::ALL_MATCHES);
+ AutocompleteInput you_input(ASCIIToUTF16("you"), string16::npos, string16(),
+ true, false, true,
+ AutocompleteInput::ALL_MATCHES);
RunQuery(you_input, false);
EXPECT_EQ(0U, matches().size());
}

Powered by Google App Engine
This is Rietveld 408576698