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

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

Issue 2853123002: Revert of [Mac] Refactor bookmark bar controller (Closed)
Patch Set: Created 3 years, 7 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 #include <cmath> 5 #include <cmath>
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h"
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 ASSERT_TRUE(targetButton); 783 ASSERT_TRUE(targetButton);
784 [folderController dragButton:draggedButton 784 [folderController dragButton:draggedButton
785 to:[targetButton center] 785 to:[targetButton center]
786 copy:NO]; 786 copy:NO];
787 // The button should have landed just after "2f1b". 787 // The button should have landed just after "2f1b".
788 const std::string expected_string("2f:[ 2f1b 1b 2f2f:[ 2f2f1b " 788 const std::string expected_string("2f:[ 2f1b 1b 2f2f:[ 2f2f1b "
789 "2f2f2b 2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ " 789 "2f2f2b 2f2f3b ] 2f3b ] 3b 4f:[ 4f1f:[ 4f1f1b 4f1f2b 4f1f3b ] 4f2f:[ "
790 "4f2f1b 4f2f2b 4f2f3b ] 4f3f:[ 4f3f1b 4f3f2b 4f3f3b ] ] 5b "); 790 "4f2f1b 4f2f2b 4f2f3b ] 4f3f:[ 4f3f1b 4f3f2b 4f3f3b ] ] 5b ");
791 EXPECT_EQ(expected_string, bookmarks::test::ModelStringFromNode(root)); 791 EXPECT_EQ(expected_string, bookmarks::test::ModelStringFromNode(root));
792 792
793 // Reopen the window. 793 // Verify the window still appears by looking for its controller.
794 [[toFolder target] performSelector:@selector(openBookmarkFolderFromButton:)
795 withObject:toFolder];
796 EXPECT_TRUE([bar_ folderController]); 794 EXPECT_TRUE([bar_ folderController]);
797 folderController = [bar_ folderController];
798 795
799 // Gather the new frames. 796 // Gather the new frames.
800 NSRect newToFolderFrame = [toFolder frame]; 797 NSRect newToFolderFrame = [toFolder frame];
801 NSRect newToWindowFrame = [toWindow frame]; 798 NSRect newToWindowFrame = [toWindow frame];
802 // The toFolder should have shifted left horizontally but not vertically. 799 // The toFolder should have shifted left horizontally but not vertically.
803 NSRect expectedToFolderFrame = 800 NSRect expectedToFolderFrame =
804 NSOffsetRect(oldToFolderFrame, -horizontalShift, 0); 801 NSOffsetRect(oldToFolderFrame, -horizontalShift, 0);
805 EXPECT_NSRECT_EQ(expectedToFolderFrame, newToFolderFrame); 802 EXPECT_NSRECT_EQ(expectedToFolderFrame, newToFolderFrame);
806 // The toWindow should have shifted left horizontally, down vertically, 803 // The toWindow should have shifted left horizontally, down vertically,
807 // and grown vertically. 804 // and grown vertically.
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1727 DeleteBookmark([folder parentButton], profile()); 1724 DeleteBookmark([folder parentButton], profile());
1728 EXPECT_FALSE([folder folderController]); 1725 EXPECT_FALSE([folder folderController]);
1729 } 1726 }
1730 1727
1731 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so 1728 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so
1732 // they are hard to test. Factor out "fire timers" into routines 1729 // they are hard to test. Factor out "fire timers" into routines
1733 // which can be overridden to fire immediately to make behavior 1730 // which can be overridden to fire immediately to make behavior
1734 // confirmable. 1731 // confirmable.
1735 // There is a similar problem with mouseEnteredButton: and 1732 // There is a similar problem with mouseEnteredButton: and
1736 // mouseExitedButton:. 1733 // mouseExitedButton:.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698