| OLD | NEW |
| 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 Loading... |
| 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 if (model->synced_node()->IsVisible()) { | 178 EXPECT_TRUE([titles containsObject:@"Mobile Bookmarks"]); |
| 179 EXPECT_TRUE([titles containsObject:@"Synced Bookmarks"]); | |
| 180 } else { | |
| 181 EXPECT_FALSE([titles containsObject:@"Synced Bookmarks"]); | |
| 182 } | |
| 183 } | 179 } |
| 184 | 180 |
| 185 // Confirm ability to handle folders with blank name. | 181 // Confirm ability to handle folders with blank name. |
| 186 TEST_F(BookmarkBubbleControllerTest, TestFolderWithBlankName) { | 182 TEST_F(BookmarkBubbleControllerTest, TestFolderWithBlankName) { |
| 187 // Create some folders, including a nested folder | 183 // Create some folders, including a nested folder |
| 188 BookmarkModel* model = GetBookmarkModel(); | 184 BookmarkModel* model = GetBookmarkModel(); |
| 189 EXPECT_TRUE(model); | 185 EXPECT_TRUE(model); |
| 190 const BookmarkNode* bookmarkBarNode = model->bookmark_bar_node(); | 186 const BookmarkNode* bookmarkBarNode = model->bookmark_bar_node(); |
| 191 EXPECT_TRUE(bookmarkBarNode); | 187 EXPECT_TRUE(bookmarkBarNode); |
| 192 const BookmarkNode* node1 = model->AddFolder(bookmarkBarNode, 0, | 188 const BookmarkNode* node1 = model->AddFolder(bookmarkBarNode, 0, |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 // Normally this would be sent up the responder tree correctly, but since | 486 // Normally this would be sent up the responder tree correctly, but since |
| 491 // tests run in the background, key window and main window are never set on | 487 // tests run in the background, key window and main window are never set on |
| 492 // NSApplication. Adding it to NSApplication directly removes the need for | 488 // NSApplication. Adding it to NSApplication directly removes the need for |
| 493 // worrying about what the current window with focus is. | 489 // worrying about what the current window with focus is. |
| 494 - (void)editBookmarkNode:(id)sender { | 490 - (void)editBookmarkNode:(id)sender { |
| 495 EXPECT_TRUE([sender respondsToSelector:@selector(node)]); | 491 EXPECT_TRUE([sender respondsToSelector:@selector(node)]); |
| 496 BookmarkBubbleControllerTest::edits_++; | 492 BookmarkBubbleControllerTest::edits_++; |
| 497 } | 493 } |
| 498 | 494 |
| 499 @end | 495 @end |
| OLD | NEW |