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

Side by Side Diff: chrome/test/live_sync/bookmark_model_verifier.cc

Issue 3152034: Remove wstrings in bookmarks, part 5. (Closed)
Patch Set: yet moar Created 10 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/live_sync/bookmark_model_verifier.h" 5 #include "chrome/test/live_sync/bookmark_model_verifier.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include <stack> 8 #include <stack>
9 9
10 #include "app/tree_node_iterator.h" 10 #include "app/tree_node_iterator.h"
11 #include "base/rand_util.h" 11 #include "base/rand_util.h"
12 #include "base/string_number_conversions.h" 12 #include "base/string_number_conversions.h"
13 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/bookmarks/bookmark_model.h" 14 #include "chrome/browser/bookmarks/bookmark_model.h"
14 #include "chrome/browser/bookmarks/bookmark_utils.h" 15 #include "chrome/browser/bookmarks/bookmark_utils.h"
15 #include "chrome/test/live_sync/live_bookmarks_sync_test.h" 16 #include "chrome/test/live_sync/live_bookmarks_sync_test.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 #include "third_party/skia/include/core/SkBitmap.h" 18 #include "third_party/skia/include/core/SkBitmap.h"
18 19
19 using std::string; 20 using std::string;
20 using std::wstring; 21 using std::wstring;
21 22
22 // static 23 // static
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 177 }
177 } 178 }
178 return bm_folder; 179 return bm_folder;
179 } 180 }
180 181
181 const BookmarkNode* BookmarkModelVerifier::AddURL(BookmarkModel* model, 182 const BookmarkNode* BookmarkModelVerifier::AddURL(BookmarkModel* model,
182 const BookmarkNode* parent, int index, const wstring& title, 183 const BookmarkNode* parent, int index, const wstring& title,
183 const GURL& url) { 184 const GURL& url) {
184 const BookmarkNode* v_parent = NULL; 185 const BookmarkNode* v_parent = NULL;
185 FindNodeInVerifier(model, parent, &v_parent); 186 FindNodeInVerifier(model, parent, &v_parent);
186 const BookmarkNode* result = model->AddURL(parent, index, title, url); 187 const BookmarkNode* result = model->AddURL(parent, index,
188 WideToUTF16Hack(title), url);
187 EXPECT_TRUE(result); 189 EXPECT_TRUE(result);
188 if (!result) 190 if (!result)
189 return NULL; 191 return NULL;
190 const BookmarkNode* v_node = model_->AddURL(v_parent, index, title, url); 192 const BookmarkNode* v_node = model_->AddURL(v_parent, index,
193 WideToUTF16Hack(title), url);
191 EXPECT_TRUE(v_node); 194 EXPECT_TRUE(v_node);
192 if (!v_node) 195 if (!v_node)
193 return NULL; 196 return NULL;
194 ExpectBookmarkInfoMatch(v_node, result); 197 ExpectBookmarkInfoMatch(v_node, result);
195 return result; 198 return result;
196 } 199 }
197 200
198 void BookmarkModelVerifier::SetTitle(BookmarkModel* model, 201 void BookmarkModelVerifier::SetTitle(BookmarkModel* model,
199 const BookmarkNode* node, 202 const BookmarkNode* node,
200 const wstring& title) { 203 const wstring& title) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 const BookmarkNode* v_node = NULL; 250 const BookmarkNode* v_node = NULL;
248 FindNodeInVerifier(model, node, &v_node); 251 FindNodeInVerifier(model, node, &v_node);
249 const BookmarkNode* result = bookmark_utils::ApplyEditsWithNoGroupChange( 252 const BookmarkNode* result = bookmark_utils::ApplyEditsWithNoGroupChange(
250 model, node->GetParent(), BookmarkEditor::EditDetails(node), 253 model, node->GetParent(), BookmarkEditor::EditDetails(node),
251 node->GetTitleAsString16(), new_url); 254 node->GetTitleAsString16(), new_url);
252 bookmark_utils::ApplyEditsWithNoGroupChange(model_, v_node->GetParent(), 255 bookmark_utils::ApplyEditsWithNoGroupChange(model_, v_node->GetParent(),
253 BookmarkEditor::EditDetails(v_node), v_node->GetTitleAsString16(), 256 BookmarkEditor::EditDetails(v_node), v_node->GetTitleAsString16(),
254 new_url); 257 new_url);
255 return result; 258 return result;
256 } 259 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bookmark_bar_view_unittest.cc ('k') | chrome/test/live_sync/two_client_live_bookmarks_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698