Index: chrome/browser/ui/cocoa/framed_browser_window_unittest.mm |
diff --git a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm |
index 5de0038defc77c1805b11fa722185386d42f7f44..de88f68d6d8dfd6d86bf8bf7c9aad93ef6fa9513 100644 |
--- a/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm |
+++ b/chrome/browser/ui/cocoa/framed_browser_window_unittest.mm |
@@ -100,7 +100,18 @@ TEST_F(FramedBrowserWindowTest, DoesHideTitle) { |
// Test to make sure that our window widgets are in the right place. |
TEST_F(FramedBrowserWindowTest, WindowWidgetLocation) { |
- // First without tabstrip. |
+ BOOL yes = YES; |
+ BOOL no = NO; |
+ |
+ // First without a tabstrip. |
+ id controller = [OCMockObject mockForClass:[BrowserWindowController class]]; |
+ [[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] |
+ isKindOfClass:[BrowserWindowController class]]; |
Robert Sesek
2011/11/15 15:22:43
nit: indent 4
|
+ [[[controller expect] andReturnValue:OCMOCK_VALUE(no)] hasTabStrip]; |
+ [[[controller expect] andReturnValue:OCMOCK_VALUE(yes)] hasTitleBar]; |
+ [[[controller expect] andReturnValue:OCMOCK_VALUE(no)] isTabbedWindow]; |
+ [window_ setWindowController:controller]; |
+ |
NSView* closeBoxControl = [window_ standardWindowButton:NSWindowCloseButton]; |
EXPECT_TRUE(closeBoxControl); |
NSRect closeBoxFrame = [closeBoxControl frame]; |
@@ -124,9 +135,7 @@ TEST_F(FramedBrowserWindowTest, WindowWidgetLocation) { |
NSMaxX(closeBoxFrame) + [window_ windowButtonsInterButtonSpacing]); |
// Then with a tabstrip. |
- id controller = [OCMockObject mockForClass:[BrowserWindowController class]]; |
- BOOL yes = YES; |
- BOOL no = NO; |
+ controller = [OCMockObject mockForClass:[BrowserWindowController class]]; |
[[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] |
isKindOfClass:[BrowserWindowController class]]; |
[[[controller expect] andReturnValue:OCMOCK_VALUE(yes)] hasTabStrip]; |
@@ -156,4 +165,3 @@ TEST_F(FramedBrowserWindowTest, WindowWidgetLocation) { |
NSMaxX(closeBoxFrame) + [window_ windowButtonsInterButtonSpacing]); |
[window_ setWindowController:nil]; |
} |
- |