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

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

Issue 6258015: Remove wstring from autocomplete.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/history_contents_provider_unittest.cc
===================================================================
--- chrome/browser/autocomplete/history_contents_provider_unittest.cc (revision 72331)
+++ chrome/browser/autocomplete/history_contents_provider_unittest.cc (working copy)
@@ -100,51 +100,51 @@
BrowserThread ui_thread_;
BrowserThread file_thread_;
- std::wstring history_dir_;
-
scoped_ptr<TestingProfile> profile_;
scoped_refptr<HistoryContentsProvider> provider_;
};
TEST_F(HistoryContentsProviderTest, Body) {
- AutocompleteInput input(L"FOO", std::wstring(), true, false, true, false);
+ AutocompleteInput input(ASCIIToUTF16("FOO"), string16(), true, false, true,
+ false);
RunQuery(input, false);
// The results should be the first two pages, in decreasing order.
const ACMatches& m = matches();
ASSERT_EQ(2U, m.size());
EXPECT_EQ(test_entries[0].url, m[0].destination_url.spec());
- EXPECT_STREQ(test_entries[0].title, WideToUTF8(m[0].description).c_str());
+ EXPECT_STREQ(test_entries[0].title, UTF16ToUTF8(m[0].description).c_str());
EXPECT_EQ(test_entries[1].url, m[1].destination_url.spec());
- EXPECT_STREQ(test_entries[1].title, WideToUTF8(m[1].description).c_str());
+ EXPECT_STREQ(test_entries[1].title, UTF16ToUTF8(m[1].description).c_str());
}
TEST_F(HistoryContentsProviderTest, Title) {
- AutocompleteInput input(L"PAGEONE", std::wstring(), true, false, true, false);
+ AutocompleteInput input(ASCIIToUTF16("PAGEONE"), string16(), true, false,
+ true, false);
RunQuery(input, false);
// The results should be the first two pages.
const ACMatches& m = matches();
ASSERT_EQ(2U, m.size());
EXPECT_EQ(test_entries[0].url, m[0].destination_url.spec());
- EXPECT_STREQ(test_entries[0].title, WideToUTF8(m[0].description).c_str());
+ EXPECT_STREQ(test_entries[0].title, UTF16ToUTF8(m[0].description).c_str());
EXPECT_EQ(test_entries[1].url, m[1].destination_url.spec());
- EXPECT_STREQ(test_entries[1].title, WideToUTF8(m[1].description).c_str());
+ EXPECT_STREQ(test_entries[1].title, UTF16ToUTF8(m[1].description).c_str());
}
// The "minimal changes" flag should mean that we don't re-query the DB.
TEST_F(HistoryContentsProviderTest, MinimalChanges) {
// A minimal changes request when there have been no real queries should
// give us no results.
- AutocompleteInput sync_input(L"PAGEONE", std::wstring(), true, false, true,
- true);
+ AutocompleteInput sync_input(ASCIIToUTF16("PAGEONE"), string16(), true, false,
+ true, true);
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(L"PAGEONE", std::wstring(), true, false, true,
- false);
+ AutocompleteInput async_input(ASCIIToUTF16("PAGEONE"), string16(), true,
+ false, true, false);
RunQuery(async_input, false);
const ACMatches& m2 = matches();
EXPECT_EQ(2U, m2.size());
@@ -167,17 +167,18 @@
ASCIIToUTF16("bar"), true);
// Ask for synchronous. This should only get the bookmark.
- AutocompleteInput sync_input(L"bar", std::wstring(), true, false, true, true);
+ AutocompleteInput sync_input(ASCIIToUTF16("bar"), string16(), true, false,
+ true, true);
RunQuery(sync_input, false);
const ACMatches& m1 = matches();
ASSERT_EQ(1U, m1.size());
EXPECT_EQ(bookmark_url, m1[0].destination_url);
- EXPECT_EQ(L"bar", m1[0].description);
+ EXPECT_EQ(ASCIIToUTF16("bar"), m1[0].description);
EXPECT_TRUE(m1[0].starred);
// Ask for async. We should get the bookmark immediately.
- AutocompleteInput async_input(L"bar", std::wstring(), true, false, true,
- false);
+ AutocompleteInput async_input(ASCIIToUTF16("bar"), string16(), true, false,
+ true, false);
provider()->Start(async_input, false);
const ACMatches& m2 = matches();
ASSERT_EQ(1U, m2.size());
@@ -199,7 +200,8 @@
// Tests that history is deleted properly.
TEST_F(HistoryContentsProviderTest, DeleteMatch) {
- AutocompleteInput input(L"bar", std::wstring(), true, false, true, false);
+ AutocompleteInput input(ASCIIToUTF16("bar"), string16(), true, false, true,
+ false);
RunQuery(input, false);
// Query; the result should be the third page.
@@ -223,7 +225,8 @@
ASCIIToUTF16("bar"), true);
// Get the match to delete its history
- AutocompleteInput input(L"bar", std::wstring(), true, false, true, false);
+ AutocompleteInput input(ASCIIToUTF16("bar"), string16(), true, false, true,
+ false);
RunQuery(input, false);
const ACMatches& m = matches();
ASSERT_EQ(1U, m.size());
@@ -233,7 +236,8 @@
EXPECT_EQ(1U, matches().size());
// Run a query that would only match history (but the history is deleted)
- AutocompleteInput you_input(L"you", std::wstring(), true, false, true, false);
+ AutocompleteInput you_input(ASCIIToUTF16("you"), string16(), true, false,
+ true, false);
RunQuery(you_input, false);
EXPECT_EQ(0U, matches().size());
« no previous file with comments | « chrome/browser/autocomplete/history_contents_provider.cc ('k') | chrome/browser/autocomplete/history_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698