OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 6 |
7 #include "base/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
9 #import "chrome/browser/cocoa/chrome_browser_window.h" | 9 #import "chrome/browser/cocoa/chrome_browser_window.h" |
10 #import "chrome/browser/cocoa/browser_window_controller.h" | 10 #import "chrome/browser/cocoa/browser_window_controller.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 NSRect miniaturizeFrame = [miniaturizeControl frame]; | 113 NSRect miniaturizeFrame = [miniaturizeControl frame]; |
114 EXPECT_EQ(NSMaxY(miniaturizeFrame), | 114 EXPECT_EQ(NSMaxY(miniaturizeFrame), |
115 NSMaxY(windowBounds) - | 115 NSMaxY(windowBounds) - |
116 kChromeWindowButtonsWithoutTabStripOffsetFromTop); | 116 kChromeWindowButtonsWithoutTabStripOffsetFromTop); |
117 EXPECT_EQ(NSMinX(miniaturizeFrame), | 117 EXPECT_EQ(NSMinX(miniaturizeFrame), |
118 NSMaxX(closeBoxFrame) + kChromeWindowButtonsInterButtonSpacing); | 118 NSMaxX(closeBoxFrame) + kChromeWindowButtonsInterButtonSpacing); |
119 | 119 |
120 // Then with a tabstrip. | 120 // Then with a tabstrip. |
121 id controller = [OCMockObject mockForClass:[BrowserWindowController class]]; | 121 id controller = [OCMockObject mockForClass:[BrowserWindowController class]]; |
122 BOOL yes = YES; | 122 BOOL yes = YES; |
| 123 BOOL no = NO; |
123 [[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] | 124 [[[controller stub] andReturnValue:OCMOCK_VALUE(yes)] |
124 isKindOfClass:[BrowserWindowController class]]; | 125 isKindOfClass:[BrowserWindowController class]]; |
| 126 [[[controller expect] andReturnValue:OCMOCK_VALUE(yes)] hasTabStrip]; |
| 127 [[[controller expect] andReturnValue:OCMOCK_VALUE(no)] hasTitleBar]; |
125 [[[controller expect] andReturnValue:OCMOCK_VALUE(yes)] isNormalWindow]; | 128 [[[controller expect] andReturnValue:OCMOCK_VALUE(yes)] isNormalWindow]; |
126 [window_ setWindowController:controller]; | 129 [window_ setWindowController:controller]; |
127 | 130 |
128 closeBoxCell = [window_ accessibilityAttributeValue: | 131 closeBoxCell = [window_ accessibilityAttributeValue: |
129 NSAccessibilityCloseButtonAttribute]; | 132 NSAccessibilityCloseButtonAttribute]; |
130 closeBoxControl = [closeBoxCell controlView]; | 133 closeBoxControl = [closeBoxCell controlView]; |
131 EXPECT_TRUE(closeBoxControl); | 134 EXPECT_TRUE(closeBoxControl); |
132 closeBoxFrame = [closeBoxControl frame]; | 135 closeBoxFrame = [closeBoxControl frame]; |
133 windowBounds = [window_ frame]; | 136 windowBounds = [window_ frame]; |
134 windowBounds.origin = NSZeroPoint; | 137 windowBounds.origin = NSZeroPoint; |
(...skipping 30 matching lines...) Expand all Loading... |
165 NSRect rect = [area rect]; | 168 NSRect rect = [area rect]; |
166 foundArea = NSPointInRect(point, rect); | 169 foundArea = NSPointInRect(point, rect); |
167 if (foundArea) { | 170 if (foundArea) { |
168 EXPECT_TRUE([[area owner] isEqual:frameView]); | 171 EXPECT_TRUE([[area owner] isEqual:frameView]); |
169 break; | 172 break; |
170 } | 173 } |
171 } | 174 } |
172 EXPECT_TRUE(foundArea); | 175 EXPECT_TRUE(foundArea); |
173 } | 176 } |
174 | 177 |
OLD | NEW |