diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 15:35:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 15:35:25 +0000 |
commit | e5366896e9ccb3dd17c590d115bd999e987a33af (patch) | |
tree | 52f4fc2f07b73aaca1199adb1384b123130c22ed /chrome/browser/history/url_database_unittest.cc | |
parent | b133cc2db84fc83d5c4aa53020237788fa344c75 (diff) | |
download | chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.zip chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.gz chromium_src-e5366896e9ccb3dd17c590d115bd999e987a33af.tar.bz2 |
Replace wstring with string16 in history. The only time wstring is used now in history is for bookmark-related stuff (the bookmarks system is still wstring-based).
The substantial change here is in RTL to make a string16 variant of the functions and in changing the WordIterator to use string16 (this cleaned up some weird utf-32 code).
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/2808017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/url_database_unittest.cc')
-rw-r--r-- | chrome/browser/history/url_database_unittest.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/history/url_database_unittest.cc b/chrome/browser/history/url_database_unittest.cc index d6dc43f..32ded0c 100644 --- a/chrome/browser/history/url_database_unittest.cc +++ b/chrome/browser/history/url_database_unittest.cc @@ -7,6 +7,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/history/url_database.h" #include "testing/gtest/include/gtest/gtest.h" @@ -71,7 +72,7 @@ TEST_F(URLDatabaseTest, AddURL) { // first, add two URLs const GURL url1("http://www.google.com/"); URLRow url_info1(url1); - url_info1.set_title(L"Google"); + url_info1.set_title(UTF8ToUTF16("Google")); url_info1.set_visit_count(4); url_info1.set_typed_count(2); url_info1.set_last_visit(Time::Now() - TimeDelta::FromDays(1)); @@ -80,7 +81,7 @@ TEST_F(URLDatabaseTest, AddURL) { const GURL url2("http://mail.google.com/"); URLRow url_info2(url2); - url_info2.set_title(L"Google Mail"); + url_info2.set_title(UTF8ToUTF16("Google Mail")); url_info2.set_visit_count(3); url_info2.set_typed_count(0); url_info2.set_last_visit(Time::Now() - TimeDelta::FromDays(2)); @@ -96,7 +97,7 @@ TEST_F(URLDatabaseTest, AddURL) { EXPECT_TRUE(IsURLRowEqual(url_info2, info)); // update the second - url_info2.set_title(L"Google Mail Too"); + url_info2.set_title(UTF8ToUTF16("Google Mail Too")); url_info2.set_visit_count(4); url_info2.set_typed_count(1); url_info2.set_typed_count(91011); @@ -125,7 +126,7 @@ TEST_F(URLDatabaseTest, AddURL) { TEST_F(URLDatabaseTest, KeywordSearchTermVisit) { const GURL url1("http://www.google.com/"); URLRow url_info1(url1); - url_info1.set_title(L"Google"); + url_info1.set_title(UTF8ToUTF16("Google")); url_info1.set_visit_count(4); url_info1.set_typed_count(2); url_info1.set_last_visit(Time::Now() - TimeDelta::FromDays(1)); @@ -134,20 +135,20 @@ TEST_F(URLDatabaseTest, KeywordSearchTermVisit) { ASSERT_TRUE(url_id != 0); // Add a keyword visit. - ASSERT_TRUE(SetKeywordSearchTermsForURL(url_id, 1, L"visit")); + ASSERT_TRUE(SetKeywordSearchTermsForURL(url_id, 1, UTF8ToUTF16("visit"))); // Make sure we get it back. std::vector<KeywordSearchTermVisit> matches; - GetMostRecentKeywordSearchTerms(1, L"visit", 10, &matches); + GetMostRecentKeywordSearchTerms(1, UTF8ToUTF16("visit"), 10, &matches); ASSERT_EQ(1U, matches.size()); - ASSERT_EQ(L"visit", matches[0].term); + ASSERT_EQ(UTF8ToUTF16("visit"), matches[0].term); // Delete the keyword visit. DeleteAllSearchTermsForKeyword(1); // Make sure we don't get it back when querying. matches.clear(); - GetMostRecentKeywordSearchTerms(1, L"visit", 10, &matches); + GetMostRecentKeywordSearchTerms(1, UTF8ToUTF16("visit"), 10, &matches); ASSERT_EQ(0U, matches.size()); } @@ -155,7 +156,7 @@ TEST_F(URLDatabaseTest, KeywordSearchTermVisit) { TEST_F(URLDatabaseTest, DeleteURLDeletesKeywordSearchTermVisit) { const GURL url1("http://www.google.com/"); URLRow url_info1(url1); - url_info1.set_title(L"Google"); + url_info1.set_title(UTF8ToUTF16("Google")); url_info1.set_visit_count(4); url_info1.set_typed_count(2); url_info1.set_last_visit(Time::Now() - TimeDelta::FromDays(1)); @@ -164,14 +165,14 @@ TEST_F(URLDatabaseTest, DeleteURLDeletesKeywordSearchTermVisit) { ASSERT_TRUE(url_id != 0); // Add a keyword visit. - ASSERT_TRUE(SetKeywordSearchTermsForURL(url_id, 1, L"visit")); + ASSERT_TRUE(SetKeywordSearchTermsForURL(url_id, 1, UTF8ToUTF16("visit"))); // Delete the url. ASSERT_TRUE(DeleteURLRow(url_id)); // Make sure the keyword visit was deleted. std::vector<KeywordSearchTermVisit> matches; - GetMostRecentKeywordSearchTerms(1, L"visit", 10, &matches); + GetMostRecentKeywordSearchTerms(1, UTF8ToUTF16("visit"), 10, &matches); ASSERT_EQ(0U, matches.size()); } |