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 #include "base/scoped_nsobject.h" | 5 #include "base/scoped_nsobject.h" |
6 #include "base/scoped_nsautorelease_pool.h" | 6 #include "base/scoped_nsautorelease_pool.h" |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/cocoa/browser_test_helper.h" | 9 #include "chrome/browser/cocoa/browser_test_helper.h" |
10 #include "chrome/browser/cocoa/browser_window_controller.h" | 10 #include "chrome/browser/cocoa/browser_window_controller.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // toolbar should be at 0,561 800x39 | 250 // toolbar should be at 0,561 800x39 |
251 [controller_ resizeView:infobar newHeight:0]; | 251 [controller_ resizeView:infobar newHeight:0]; |
252 [controller_ resizeView:toolbar newHeight:39]; | 252 [controller_ resizeView:toolbar newHeight:39]; |
253 EXPECT_TRUE(NSEqualRects([contentView frame], NSMakeRect(0, 0, 800, 600))); | 253 EXPECT_TRUE(NSEqualRects([contentView frame], NSMakeRect(0, 0, 800, 600))); |
254 EXPECT_TRUE(NSEqualRects([download frame], NSMakeRect(0, 0, 800, 30))); | 254 EXPECT_TRUE(NSEqualRects([download frame], NSMakeRect(0, 0, 800, 30))); |
255 EXPECT_TRUE(NSEqualRects([contentArea frame], NSMakeRect(0, 30, 800, 531))); | 255 EXPECT_TRUE(NSEqualRects([contentArea frame], NSMakeRect(0, 30, 800, 531))); |
256 EXPECT_TRUE(NSEqualRects([infobar frame], NSMakeRect(0, 561, 800, 0))); | 256 EXPECT_TRUE(NSEqualRects([infobar frame], NSMakeRect(0, 561, 800, 0))); |
257 EXPECT_TRUE(NSEqualRects([toolbar frame], NSMakeRect(0, 561, 800, 39))); | 257 EXPECT_TRUE(NSEqualRects([toolbar frame], NSMakeRect(0, 561, 800, 39))); |
258 } | 258 } |
259 | 259 |
| 260 TEST_F(BrowserWindowControllerTest, TestTopLeftForBubble) { |
| 261 NSPoint p = [controller_ topLeftForBubble]; |
| 262 NSRect all = [[controller_ window] frame]; |
| 263 |
| 264 // As a sanity check make sure the point is vaguely in the top left |
| 265 // of the window. |
| 266 EXPECT_GT(p.y, all.origin.y + (all.size.height/2)); |
| 267 EXPECT_LT(p.x, all.origin.x + (all.size.width/2)); |
| 268 } |
| 269 |
| 270 |
260 /* TODO(???): test other methods of BrowserWindowController */ | 271 /* TODO(???): test other methods of BrowserWindowController */ |
OLD | NEW |