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

Side by Side Diff: chrome/browser/bookmarks/bookmark_model_unittest.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/bookmarks/bookmark_model.h" 5 #include "chrome/browser/bookmarks/bookmark_model.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 ASSERT_EQ(BookmarkNode::URL, new_node->type()); 284 ASSERT_EQ(BookmarkNode::URL, new_node->type());
285 ASSERT_TRUE(new_node == model_.GetMostRecentlyAddedNodeForURL(url)); 285 ASSERT_TRUE(new_node == model_.GetMostRecentlyAddedNodeForURL(url));
286 286
287 EXPECT_TRUE(new_node->id() != root->id() && 287 EXPECT_TRUE(new_node->id() != root->id() &&
288 new_node->id() != model_.other_node()->id() && 288 new_node->id() != model_.other_node()->id() &&
289 new_node->id() != model_.mobile_node()->id()); 289 new_node->id() != model_.mobile_node()->id());
290 } 290 }
291 291
292 TEST_F(BookmarkModelTest, AddURLWithUnicodeTitle) { 292 TEST_F(BookmarkModelTest, AddURLWithUnicodeTitle) {
293 const BookmarkNode* root = model_.bookmark_bar_node(); 293 const BookmarkNode* root = model_.bookmark_bar_node();
294 const string16 title(WideToUTF16( 294 const string16 title(base::WideToUTF16(
295 L"\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053")); 295 L"\u767e\u5ea6\u4e00\u4e0b\uff0c\u4f60\u5c31\u77e5\u9053"));
296 const GURL url("https://www.baidu.com/"); 296 const GURL url("https://www.baidu.com/");
297 297
298 const BookmarkNode* new_node = model_.AddURL(root, 0, title, url); 298 const BookmarkNode* new_node = model_.AddURL(root, 0, title, url);
299 AssertObserverCount(1, 0, 0, 0, 0); 299 AssertObserverCount(1, 0, 0, 0, 0);
300 observer_details_.ExpectEquals(root, NULL, 0, -1); 300 observer_details_.ExpectEquals(root, NULL, 0, -1);
301 301
302 ASSERT_EQ(1, root->child_count()); 302 ASSERT_EQ(1, root->child_count());
303 ASSERT_EQ(title, new_node->GetTitle()); 303 ASSERT_EQ(title, new_node->GetTitle());
304 ASSERT_TRUE(url == new_node->url()); 304 ASSERT_TRUE(url == new_node->url());
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 1050
1051 EXPECT_TRUE(node.DeleteMetaInfo("key1")); 1051 EXPECT_TRUE(node.DeleteMetaInfo("key1"));
1052 EXPECT_TRUE(node.DeleteMetaInfo("key2")); 1052 EXPECT_TRUE(node.DeleteMetaInfo("key2"));
1053 EXPECT_FALSE(node.DeleteMetaInfo("key3")); 1053 EXPECT_FALSE(node.DeleteMetaInfo("key3"));
1054 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value)); 1054 EXPECT_FALSE(node.GetMetaInfo("key1", &out_value));
1055 EXPECT_FALSE(node.GetMetaInfo("key2", &out_value)); 1055 EXPECT_FALSE(node.GetMetaInfo("key2", &out_value));
1056 EXPECT_TRUE(node.meta_info_str().empty()); 1056 EXPECT_TRUE(node.meta_info_str().empty());
1057 } 1057 }
1058 1058
1059 } // namespace 1059 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_index_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698