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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller_unittest.mm

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
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 EXPECT_TRUE([titles containsObject:@"two"]); 168 EXPECT_TRUE([titles containsObject:@"two"]);
169 EXPECT_TRUE([titles containsObject:@"three"]); 169 EXPECT_TRUE([titles containsObject:@"three"]);
170 EXPECT_TRUE([titles containsObject:@"sub"]); 170 EXPECT_TRUE([titles containsObject:@"sub"]);
171 EXPECT_FALSE([titles containsObject:@"title1"]); 171 EXPECT_FALSE([titles containsObject:@"title1"]);
172 EXPECT_FALSE([titles containsObject:@"title2"]); 172 EXPECT_FALSE([titles containsObject:@"title2"]);
173 173
174 174
175 // Verify that the top level folders are displayed correctly. 175 // Verify that the top level folders are displayed correctly.
176 EXPECT_TRUE([titles containsObject:@"Other Bookmarks"]); 176 EXPECT_TRUE([titles containsObject:@"Other Bookmarks"]);
177 EXPECT_TRUE([titles containsObject:@"Bookmarks Bar"]); 177 EXPECT_TRUE([titles containsObject:@"Bookmarks Bar"]);
178 EXPECT_TRUE([titles containsObject:@"Mobile Bookmarks"]); 178 if (model->mobile_node()->IsVisible()) {
179 EXPECT_TRUE([titles containsObject:@"Mobile Bookmarks"]);
180 } else {
181 EXPECT_FALSE([titles containsObject:@"Mobile Bookmarks"]);
182 }
179 } 183 }
180 184
181 // Confirm ability to handle folders with blank name. 185 // Confirm ability to handle folders with blank name.
182 TEST_F(BookmarkBubbleControllerTest, TestFolderWithBlankName) { 186 TEST_F(BookmarkBubbleControllerTest, TestFolderWithBlankName) {
183 // Create some folders, including a nested folder 187 // Create some folders, including a nested folder
184 BookmarkModel* model = GetBookmarkModel(); 188 BookmarkModel* model = GetBookmarkModel();
185 EXPECT_TRUE(model); 189 EXPECT_TRUE(model);
186 const BookmarkNode* bookmarkBarNode = model->bookmark_bar_node(); 190 const BookmarkNode* bookmarkBarNode = model->bookmark_bar_node();
187 EXPECT_TRUE(bookmarkBarNode); 191 EXPECT_TRUE(bookmarkBarNode);
188 const BookmarkNode* node1 = model->AddFolder(bookmarkBarNode, 0, 192 const BookmarkNode* node1 = model->AddFolder(bookmarkBarNode, 0,
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // Normally this would be sent up the responder tree correctly, but since 490 // Normally this would be sent up the responder tree correctly, but since
487 // tests run in the background, key window and main window are never set on 491 // tests run in the background, key window and main window are never set on
488 // NSApplication. Adding it to NSApplication directly removes the need for 492 // NSApplication. Adding it to NSApplication directly removes the need for
489 // worrying about what the current window with focus is. 493 // worrying about what the current window with focus is.
490 - (void)editBookmarkNode:(id)sender { 494 - (void)editBookmarkNode:(id)sender {
491 EXPECT_TRUE([sender respondsToSelector:@selector(node)]); 495 EXPECT_TRUE([sender respondsToSelector:@selector(node)]);
492 BookmarkBubbleControllerTest::edits_++; 496 BookmarkBubbleControllerTest::edits_++;
493 } 497 }
494 498
495 @end 499 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698