summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-07 04:49:14 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-07 04:49:14 +0000
commit7b0ec59003697f626184af266d670b014c5715d5 (patch)
tree1c4864c9268e1cec9c7c83d328db3bb323fb92c9 /chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
parentc1d10a389f07e7cf1274cb4c053e5cee0bda095a (diff)
downloadchromium_src-7b0ec59003697f626184af266d670b014c5715d5.zip
chromium_src-7b0ec59003697f626184af266d670b014c5715d5.tar.gz
chromium_src-7b0ec59003697f626184af266d670b014c5715d5.tar.bz2
Reverts the revert of 22517.
Rewrites the Mac view resizing logic to have the BrowserWindowController directly resize and relayout its children views. Now when a view needs to be resized, it asks its resize delegate (typically its controller's parent) to perform the resize. BUG=http://crbug.com/17619 TEST=Make sure that views are laid out correctly, even when they change size. Open and close the bookmark bar. Trigger an infobar and then close it. Trigger the download shelf and then close it. Trigger a download shelf with the infobar open, or with the bookmark bar open. Switch to and from fullscreen with various bars open. Resize the browser window with various bars open. Start the browser with and without the bookmark bar open. Try all of the above in a popup window. Review URL: http://codereview.chromium.org/165014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm24
1 files changed, 5 insertions, 19 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm b/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
index 158069b..f260903 100644
--- a/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
@@ -32,15 +32,11 @@ typedef std::pair<GURL,WindowOpenDisposition> OpenInfo;
@implementation FakeBookmarkBarController
-- (id)initWithProfile:(Profile*)profile
- parentView:(NSView*)parentView
- webContentView:(NSView*)webContentView
- infoBarsView:(NSView*)infoBarsView {
+- (id)initWithProfile:(Profile*)profile {
if ((self = [super initWithProfile:profile
- parentView:parentView
- webContentView:webContentView
- infoBarsView:infoBarsView
- delegate:self])) {
+ initialWidth:100 // arbitrary
+ resizeDelegate:nil
+ urlDelegate:self])) {
callbacks_.reset([[NSMutableArray alloc] init]);
}
return self;
@@ -96,14 +92,8 @@ typedef std::pair<GURL,WindowOpenDisposition> OpenInfo;
class BookmarkBarBridgeTest : public testing::Test {
public:
- BookmarkBarBridgeTest() {
- NSRect content_frame = NSMakeRect(0, 0, 100, 100);
- view_.reset([[NSView alloc] initWithFrame:content_frame]);
- }
-
CocoaTestHelper cocoa_helper_;
BrowserTestHelper browser_test_helper_;
- scoped_nsobject<NSView> view_;
};
// Call all the callbacks; make sure they are all redirected to the objc object.
@@ -119,11 +109,7 @@ TEST_F(BookmarkBarBridgeTest, TestRedirect) {
[[NSView alloc] initWithFrame:NSMakeRect(0,0,100,100)]);
scoped_nsobject<FakeBookmarkBarController>
- controller([[FakeBookmarkBarController alloc]
- initWithProfile:profile
- parentView:parentView.get()
- webContentView:webView.get()
- infoBarsView:infoBarsView.get()]);
+ controller([[FakeBookmarkBarController alloc] initWithProfile:profile]);
EXPECT_TRUE(controller.get());
scoped_ptr<BookmarkBarBridge> bridge(new BookmarkBarBridge(controller.get(),
model));