summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 18:25:18 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 18:25:18 +0000
commit7458b20b76ae96f42de87e8c47d07bb8fb304a0e (patch)
tree94c877ce3ddb88608a156deb172dcae632e42739 /chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
parentf2eefdabd9adf6c31676a401b4fc01e4e9218cbe (diff)
downloadchromium_src-7458b20b76ae96f42de87e8c47d07bb8fb304a0e.zip
chromium_src-7458b20b76ae96f42de87e8c47d07bb8fb304a0e.tar.gz
chromium_src-7458b20b76ae96f42de87e8c47d07bb8fb304a0e.tar.bz2
Add a test helper to pull out some common code. Add a test for tab controller. Don't dead-strip un-referenced objective-C code in the unit_test target. Use the appropriate bundle when loading the tab nib. (take two, most of this was backed out earlier).
Review URL: http://codereview.chromium.org/77004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13859 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_controller_unittest.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller_unittest.mm17
1 files changed, 5 insertions, 12 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
index 6d6e2daa..f9abec5 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
@@ -7,6 +7,7 @@
#include "base/scoped_nsobject.h"
#import "chrome/browser/cocoa/bookmark_bar_controller.h"
#include "chrome/browser/cocoa/browser_test_helper.h"
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -16,25 +17,17 @@ static const int kContentAreaHeight = 500;
class BookmarkBarControllerTest : public testing::Test {
public:
BookmarkBarControllerTest() {
- // Bootstrap Cocoa. It's very unhappy without this.
- [NSApplication sharedApplication];
-
- // Create a window and put a content view in it that's slightly smaller in
- // height.
- NSRect frame = NSMakeRect(0, 0, 800, 600);
- window_.reset([[NSWindow alloc] initWithContentRect:frame
- styleMask:0
- backing:NSBackingStoreBuffered
- defer:NO]);
- [window_ orderFront:nil];
NSRect content_frame = NSMakeRect(0, 0, 800, kContentAreaHeight);
content_area_.reset([[NSView alloc] initWithFrame:content_frame]);
bar_.reset(
[[BookmarkBarController alloc] initWithProfile:helper_.GetProfile()
contentArea:content_area_.get()]);
+ NSView* parent = [cocoa_helper_.window() contentView];
+ [parent addSubview:content_area_.get()];
+ [parent addSubview:[bar_ view]];
}
- scoped_nsobject<NSWindow> window_;
+ CocoaTestHelper cocoa_helper_; // Inits Cocoa, creates window, etc...
scoped_nsobject<NSView> content_area_;
BrowserTestHelper helper_;
scoped_nsobject<BookmarkBarController> bar_;