diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 16:12:07 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 16:12:07 +0000 |
commit | 3deb16cc9c3938cbe4e496930ff428389f8b35d1 (patch) | |
tree | c94080257e1e9b3cf2f3b5bdfe163b591fa1779e /chrome/test | |
parent | 24f413c12946b59b6b1a6c9147b1a7980c16ae6e (diff) | |
download | chromium_src-3deb16cc9c3938cbe4e496930ff428389f8b35d1.zip chromium_src-3deb16cc9c3938cbe4e496930ff428389f8b35d1.tar.gz chromium_src-3deb16cc9c3938cbe4e496930ff428389f8b35d1.tar.bz2 |
Remove wstrings from bookmarks, part 3.
Get rid of wstring BookmarkModel::AddGroup() (and convert lots of uses; also
convert many uses of the wstring AddURL() as drive-by's).
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3115017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/live_sync/bookmark_model_verifier.cc | 11 | ||||
-rw-r--r-- | chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc | 8 | ||||
-rw-r--r-- | chrome/test/model_test_utils.cc | 4 |
3 files changed, 15 insertions, 8 deletions
diff --git a/chrome/test/live_sync/bookmark_model_verifier.cc b/chrome/test/live_sync/bookmark_model_verifier.cc index ba2904a..47eda8ad 100644 --- a/chrome/test/live_sync/bookmark_model_verifier.cc +++ b/chrome/test/live_sync/bookmark_model_verifier.cc @@ -131,11 +131,13 @@ const BookmarkNode* BookmarkModelVerifier::AddGroup(BookmarkModel* model, const BookmarkNode* parent, int index, const wstring& title) { const BookmarkNode* v_parent = NULL; FindNodeInVerifier(model, parent, &v_parent); - const BookmarkNode* result = model->AddGroup(parent, index, title); + const BookmarkNode* result = model->AddGroup(parent, index, + WideToUTF16Hack(title)); EXPECT_TRUE(result); if (!result) return NULL; - const BookmarkNode* v_node = model_->AddGroup(v_parent, index, title); + const BookmarkNode* v_node = model_->AddGroup(v_parent, index, + WideToUTF16Hack(title)); EXPECT_TRUE(v_node); if (!v_node) return NULL; @@ -246,8 +248,9 @@ const BookmarkNode* BookmarkModelVerifier::SetURL(BookmarkModel* model, FindNodeInVerifier(model, node, &v_node); const BookmarkNode* result = bookmark_utils::ApplyEditsWithNoGroupChange( model, node->GetParent(), BookmarkEditor::EditDetails(node), - node->GetTitle(), new_url); + node->GetTitleAsString16(), new_url); bookmark_utils::ApplyEditsWithNoGroupChange(model_, v_node->GetParent(), - BookmarkEditor::EditDetails(v_node), v_node->GetTitle(), new_url); + BookmarkEditor::EditDetails(v_node), v_node->GetTitleAsString16(), + new_url); return result; } diff --git a/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc b/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc index 35f2053..96941f4 100644 --- a/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc +++ b/chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc @@ -3,7 +3,9 @@ // found in the LICENSE file. #include "base/rand_util.h" +#include "base/string16.h" #include "base/string_number_conversions.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/test/live_sync/live_bookmarks_sync_test.h" @@ -122,10 +124,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest, GURL initial_url("http://www.google.com"); GURL second_url("http://www.google.com/abc"); GURL third_url("http://www.google.com/def"); - wstring title = L"Google"; + string16 title = ASCIIToUTF16("Google"); { - const BookmarkNode* google = v->AddURL(bm0, bm_bar0, 0, - title, initial_url); + const BookmarkNode* google = + v->AddURL(bm0, bm_bar0, 0, UTF16ToWideHack(title), initial_url); ASSERT_TRUE(google != NULL); } ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); diff --git a/chrome/test/model_test_utils.cc b/chrome/test/model_test_utils.cc index 218cfd8..d55a571 100644 --- a/chrome/test/model_test_utils.cc +++ b/chrome/test/model_test_utils.cc @@ -4,6 +4,7 @@ #include "model_test_utils.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "googleurl/src/gurl.h" @@ -47,7 +48,8 @@ std::wstring::size_type AddNodesFromString(BookmarkModel& model, tell = node_name.substr(part_length - 2, 2); if (tell == folder_tell) { node_name = node_name.substr(0, part_length - 2); - const BookmarkNode* new_node = model.AddGroup(node, index, node_name); + const BookmarkNode* new_node = + model.AddGroup(node, index, WideToUTF16Hack(node_name)); end_pos = AddNodesFromString(model, new_node, model_string, end_pos + 1); } else { |