| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 bookmark_utils::AddIfNotBookmarked( | 696 bookmark_utils::AddIfNotBookmarked( |
| 697 model, GURL("http://www.cnn.com"), ASCIIToUTF16("bigger title")); | 697 model, GURL("http://www.cnn.com"), ASCIIToUTF16("bigger title")); |
| 698 menu = [bar_ menuForFolderNode:model->bookmark_bar_node()]; | 698 menu = [bar_ menuForFolderNode:model->bookmark_bar_node()]; |
| 699 EXPECT_EQ([menu numberOfItems], 2); | 699 EXPECT_EQ([menu numberOfItems], 2); |
| 700 NSMenuItem *item = [menu itemWithTitle:@"bigger title"]; | 700 NSMenuItem *item = [menu itemWithTitle:@"bigger title"]; |
| 701 EXPECT_TRUE(item); | 701 EXPECT_TRUE(item); |
| 702 item = [menu itemWithTitle:@"small"]; | 702 item = [menu itemWithTitle:@"small"]; |
| 703 EXPECT_TRUE(item); | 703 EXPECT_TRUE(item); |
| 704 if (item) { | 704 if (item) { |
| 705 int64 tag = [bar_ nodeIdFromMenuTag:[item tag]]; | 705 int64 tag = [bar_ nodeIdFromMenuTag:[item tag]]; |
| 706 const BookmarkNode* node = model->GetNodeByID(tag); | 706 const BookmarkNode* node = GetBookmarkNodeByID(model, tag); |
| 707 EXPECT_TRUE(node); | 707 EXPECT_TRUE(node); |
| 708 EXPECT_EQ(gurl, node->url()); | 708 EXPECT_EQ(gurl, node->url()); |
| 709 } | 709 } |
| 710 | 710 |
| 711 // Test with an actual folder as well | 711 // Test with an actual folder as well |
| 712 const BookmarkNode* parent = model->bookmark_bar_node(); | 712 const BookmarkNode* parent = model->bookmark_bar_node(); |
| 713 const BookmarkNode* folder = model->AddFolder(parent, | 713 const BookmarkNode* folder = model->AddFolder(parent, |
| 714 parent->child_count(), | 714 parent->child_count(), |
| 715 ASCIIToUTF16("folder")); | 715 ASCIIToUTF16("folder")); |
| 716 model->AddURL(folder, folder->child_count(), | 716 model->AddURL(folder, folder->child_count(), |
| (...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2074 "2f3b ] 4b "); | 2074 "2f3b ] 4b "); |
| 2075 actual = test::ModelStringFromNode(root); | 2075 actual = test::ModelStringFromNode(root); |
| 2076 EXPECT_EQ(expected, actual); | 2076 EXPECT_EQ(expected, actual); |
| 2077 | 2077 |
| 2078 // Verify that the other bookmark folder can't be deleted. | 2078 // Verify that the other bookmark folder can't be deleted. |
| 2079 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; | 2079 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; |
| 2080 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); | 2080 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); |
| 2081 } | 2081 } |
| 2082 | 2082 |
| 2083 } // namespace | 2083 } // namespace |
| OLD | NEW |