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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698