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 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 NSMenu *submenu = [item submenu]; | 725 NSMenu *submenu = [item submenu]; |
726 EXPECT_TRUE(submenu); | 726 EXPECT_TRUE(submenu); |
727 EXPECT_EQ(2, [submenu numberOfItems]); | 727 EXPECT_EQ(2, [submenu numberOfItems]); |
728 EXPECT_TRUE([submenu itemWithTitle:@"f1"]); | 728 EXPECT_TRUE([submenu itemWithTitle:@"f1"]); |
729 EXPECT_TRUE([submenu itemWithTitle:@"f2"]); | 729 EXPECT_TRUE([submenu itemWithTitle:@"f2"]); |
730 } | 730 } |
731 | 731 |
732 // Confirm openBookmark: forwards the request to the controller's delegate | 732 // Confirm openBookmark: forwards the request to the controller's delegate |
733 TEST_F(BookmarkBarControllerTest, OpenBookmark) { | 733 TEST_F(BookmarkBarControllerTest, OpenBookmark) { |
734 GURL gurl("http://walla.walla.ding.dong.com"); | 734 GURL gurl("http://walla.walla.ding.dong.com"); |
735 scoped_ptr<BookmarkNode> node(new BookmarkNode(gurl)); | 735 std::unique_ptr<BookmarkNode> node(new BookmarkNode(gurl)); |
736 | 736 |
737 base::scoped_nsobject<BookmarkButtonCell> cell( | 737 base::scoped_nsobject<BookmarkButtonCell> cell( |
738 [[BookmarkButtonCell alloc] init]); | 738 [[BookmarkButtonCell alloc] init]); |
739 [cell setBookmarkNode:node.get()]; | 739 [cell setBookmarkNode:node.get()]; |
740 base::scoped_nsobject<BookmarkButton> button([[BookmarkButton alloc] init]); | 740 base::scoped_nsobject<BookmarkButton> button([[BookmarkButton alloc] init]); |
741 [button setCell:cell.get()]; | 741 [button setCell:cell.get()]; |
742 [cell setRepresentedObject:[NSValue valueWithPointer:node.get()]]; | 742 [cell setRepresentedObject:[NSValue valueWithPointer:node.get()]]; |
743 | 743 |
744 [bar_ openBookmark:button]; | 744 [bar_ openBookmark:button]; |
745 EXPECT_EQ(noOpenBar()->urls_[0], node->url()); | 745 EXPECT_EQ(noOpenBar()->urls_[0], node->url()); |
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2141 "2f3b ] 4b "); | 2141 "2f3b ] 4b "); |
2142 actual = bookmarks::test::ModelStringFromNode(root); | 2142 actual = bookmarks::test::ModelStringFromNode(root); |
2143 EXPECT_EQ(expected, actual); | 2143 EXPECT_EQ(expected, actual); |
2144 | 2144 |
2145 // Verify that the other bookmark folder can't be deleted. | 2145 // Verify that the other bookmark folder can't be deleted. |
2146 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; | 2146 BookmarkButton *otherButton = [bar_ otherBookmarksButton]; |
2147 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); | 2147 EXPECT_FALSE([bar_ canDragBookmarkButtonToTrash:otherButton]); |
2148 } | 2148 } |
2149 | 2149 |
2150 } // namespace | 2150 } // namespace |
OLD | NEW |