OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_model.h" | 5 #include "components/bookmarks/browser/bookmark_model.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 TestNode bbn; | 1107 TestNode bbn; |
1108 PopulateNodeFromString("B", &bbn); | 1108 PopulateNodeFromString("B", &bbn); |
1109 const BookmarkNode* parent = model_->mobile_node(); | 1109 const BookmarkNode* parent = model_->mobile_node(); |
1110 PopulateBookmarkNode(&bbn, model_.get(), parent); | 1110 PopulateBookmarkNode(&bbn, model_.get(), parent); |
1111 EXPECT_TRUE(parent->GetChild(0)->IsVisible()); | 1111 EXPECT_TRUE(parent->GetChild(0)->IsVisible()); |
1112 | 1112 |
1113 // Mobile folder should be visible now that it has a child. | 1113 // Mobile folder should be visible now that it has a child. |
1114 EXPECT_TRUE(model_->mobile_node()->IsVisible()); | 1114 EXPECT_TRUE(model_->mobile_node()->IsVisible()); |
1115 } | 1115 } |
1116 | 1116 |
1117 TEST_F(BookmarkModelTest, MobileNodeVisibileWithChildren) { | 1117 TEST_F(BookmarkModelTest, MobileNodeVisibleWithChildren) { |
1118 const BookmarkNode* root = model_->mobile_node(); | 1118 const BookmarkNode* root = model_->mobile_node(); |
1119 const base::string16 title(ASCIIToUTF16("foo")); | 1119 const base::string16 title(ASCIIToUTF16("foo")); |
1120 const GURL url("http://foo.com"); | 1120 const GURL url("http://foo.com"); |
1121 | 1121 |
1122 model_->AddURL(root, 0, title, url); | 1122 model_->AddURL(root, 0, title, url); |
1123 EXPECT_TRUE(model_->mobile_node()->IsVisible()); | 1123 EXPECT_TRUE(model_->mobile_node()->IsVisible()); |
1124 } | 1124 } |
1125 | 1125 |
1126 TEST_F(BookmarkModelTest, ExtensiveChangesObserver) { | 1126 TEST_F(BookmarkModelTest, ExtensiveChangesObserver) { |
1127 AssertExtensiveChangesObserverCount(0, 0); | 1127 AssertExtensiveChangesObserverCount(0, 0); |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 std::set<GURL> changed_page_urls; | 1414 std::set<GURL> changed_page_urls; |
1415 changed_page_urls.insert(kPageURL1); | 1415 changed_page_urls.insert(kPageURL1); |
1416 model_->OnFaviconsChanged(changed_page_urls, kFaviconURL12); | 1416 model_->OnFaviconsChanged(changed_page_urls, kFaviconURL12); |
1417 ASSERT_EQ(2u, updated_nodes_.size()); | 1417 ASSERT_EQ(2u, updated_nodes_.size()); |
1418 EXPECT_TRUE(WasNodeUpdated(node1)); | 1418 EXPECT_TRUE(WasNodeUpdated(node1)); |
1419 EXPECT_TRUE(WasNodeUpdated(node2)); | 1419 EXPECT_TRUE(WasNodeUpdated(node2)); |
1420 } | 1420 } |
1421 } | 1421 } |
1422 | 1422 |
1423 } // namespace bookmarks | 1423 } // namespace bookmarks |
OLD | NEW |