OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |