summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-24 22:46:09 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-24 22:46:09 +0000
commit190a17a1083f6634348c4f13f07d83243a2bd8e1 (patch)
tree8c1cc945a8218b5264de702b8634ca7e11962eb5 /chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
parentd1d60a6ca7101b3b0bdca8f0acf830930cafb3c2 (diff)
downloadchromium_src-190a17a1083f6634348c4f13f07d83243a2bd8e1.zip
chromium_src-190a17a1083f6634348c4f13f07d83243a2bd8e1.tar.gz
chromium_src-190a17a1083f6634348c4f13f07d83243a2bd8e1.tar.bz2
Re-evaluate the visibility of the "Bookmarks go here..." text visibility when moving a bookmark from and to the Other Bookmarks folder.
BUG=44712 TEST=1) Start with a fresh Chrome and do not import bookmarks. 2) Show the bookmarks bar. 3) Verify that the "For quick access..." text appears in the bookmark bar. 4) Add a bookmark to Other Bookmarks. 5) Verify that the "For quick access..." text still appears in the bookmark bar. 6) Drag the bookmark from Other Bookmarks onto the bookmark bar. 7) Verify that the "For quick access..." text does not appear in the bookmark bar. 8) Drag the bookmark back to the Other Bookmarks. 9) Verify that the "For quick access..." text appears in the bookmark bar. Review URL: http://codereview.chromium.org/2080022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller_unittest.mm19
1 files changed, 16 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
index 5ea549c..300d01c 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
@@ -507,7 +507,7 @@ TEST_F(BookmarkBarControllerTest, FrameChangeNotification) {
// bookmark, and comes back when we delete the bookmark.
TEST_F(BookmarkBarControllerTest, NoItemContainerGoesAway) {
BookmarkModel* model = helper_.profile()->GetBookmarkModel();
- const BookmarkNode* parent = model->GetBookmarkBarNode();
+ const BookmarkNode* bar = model->GetBookmarkBarNode();
[bar_ loaded:model];
BookmarkBarView* view = [bar_ buttonView];
@@ -516,11 +516,24 @@ TEST_F(BookmarkBarControllerTest, NoItemContainerGoesAway) {
DCHECK(noItemContainer);
EXPECT_FALSE([noItemContainer isHidden]);
- const BookmarkNode* node = model->AddURL(parent, parent->GetChildCount(),
+ const BookmarkNode* node = model->AddURL(bar, bar->GetChildCount(),
L"title",
GURL("http://www.google.com"));
EXPECT_TRUE([noItemContainer isHidden]);
- model->Remove(parent, parent->IndexOfChild(node));
+ model->Remove(bar, bar->IndexOfChild(node));
+ EXPECT_FALSE([noItemContainer isHidden]);
+
+ // Now try it using a bookmark from the Other Bookmarks.
+ const BookmarkNode* otherBookmarks = model->other_node();
+ node = model->AddURL(otherBookmarks, otherBookmarks->GetChildCount(),
+ L"TheOther",
+ GURL("http://www.other.com"));
+ EXPECT_FALSE([noItemContainer isHidden]);
+ // Move it from Other Bookmarks to the bar.
+ model->Move(node, bar, 0);
+ EXPECT_TRUE([noItemContainer isHidden]);
+ // Move it back to Other Bookmarks from the bar.
+ model->Move(node, otherBookmarks, 0);
EXPECT_FALSE([noItemContainer isHidden]);
}