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

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

Issue 8772064: Adds back BookmarkNode::IsVisible. Turns out we want to conditionally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years 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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.cc ('k') | chrome/browser/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 AssertObserverCount(0, 0, 0, 0, 1); 1074 AssertObserverCount(0, 0, 0, 0, 1);
1075 1075
1076 // Make sure the order matches (remember, 'a' and 'C' are folders and 1076 // Make sure the order matches (remember, 'a' and 'C' are folders and
1077 // come first). 1077 // come first).
1078 EXPECT_EQ(parent->GetChild(0)->GetTitle(), ASCIIToUTF16("a")); 1078 EXPECT_EQ(parent->GetChild(0)->GetTitle(), ASCIIToUTF16("a"));
1079 EXPECT_EQ(parent->GetChild(1)->GetTitle(), ASCIIToUTF16("C")); 1079 EXPECT_EQ(parent->GetChild(1)->GetTitle(), ASCIIToUTF16("C"));
1080 EXPECT_EQ(parent->GetChild(2)->GetTitle(), ASCIIToUTF16("B")); 1080 EXPECT_EQ(parent->GetChild(2)->GetTitle(), ASCIIToUTF16("B"));
1081 EXPECT_EQ(parent->GetChild(3)->GetTitle(), ASCIIToUTF16("d")); 1081 EXPECT_EQ(parent->GetChild(3)->GetTitle(), ASCIIToUTF16("d"));
1082 } 1082 }
1083 1083
1084 TEST_F(BookmarkModelTest, NodeVisibility) {
1085 EXPECT_TRUE(model_.bookmark_bar_node()->IsVisible());
1086 EXPECT_TRUE(model_.other_node()->IsVisible());
1087 // Mobile node invisible by default
1088 EXPECT_FALSE(model_.mobile_node()->IsVisible());
1089
1090 // Arbitrary node should be visible
1091 TestNode bbn;
1092 PopulateNodeFromString("B", &bbn);
1093 const BookmarkNode* parent = model_.bookmark_bar_node();
1094 PopulateBookmarkNode(&bbn, &model_, parent);
1095 EXPECT_TRUE(parent->GetChild(0)->IsVisible());
1096 }
1097
1098 TEST_F(BookmarkModelTest, MobileNodeVisibileWithChildren) {
1099 const BookmarkNode* root = model_.mobile_node();
1100 const string16 title(ASCIIToUTF16("foo"));
1101 const GURL url("http://foo.com");
1102
1103 model_.AddURL(root, 0, title, url);
1104 EXPECT_TRUE(model_.mobile_node()->IsVisible());
1105 }
1106
1084 } // namespace 1107 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_model.cc ('k') | chrome/browser/bookmarks/bookmark_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698