| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 EXPECT_EQ(screenFrame.size.height, zoomFrame.size.height); | 608 EXPECT_EQ(screenFrame.size.height, zoomFrame.size.height); |
| 609 EXPECT_EQ(testFrame.origin.x, zoomFrame.origin.x); | 609 EXPECT_EQ(testFrame.origin.x, zoomFrame.origin.x); |
| 610 EXPECT_EQ(screenFrame.origin.y, zoomFrame.origin.y); | 610 EXPECT_EQ(screenFrame.origin.y, zoomFrame.origin.y); |
| 611 } | 611 } |
| 612 | 612 |
| 613 TEST_F(BrowserWindowControllerTest, TestFindBarOnTop) { | 613 TEST_F(BrowserWindowControllerTest, TestFindBarOnTop) { |
| 614 FindBarBridge bridge(NULL); | 614 FindBarBridge bridge(NULL); |
| 615 [controller_ addFindBar:bridge.find_bar_cocoa_controller()]; | 615 [controller_ addFindBar:bridge.find_bar_cocoa_controller()]; |
| 616 | 616 |
| 617 // Test that the Z-order of the find bar is on top of everything. | 617 // Test that the Z-order of the find bar is on top of everything. |
| 618 NSArray* subviews = [[[controller_ window] contentView] subviews]; | 618 NSArray* subviews = [controller_.chromeContentView subviews]; |
| 619 NSUInteger findBar_index = | 619 NSUInteger findBar_index = |
| 620 [subviews indexOfObject:[controller_ findBarView]]; | 620 [subviews indexOfObject:[controller_ findBarView]]; |
| 621 EXPECT_NE(NSNotFound, findBar_index); | 621 EXPECT_NE(NSNotFound, findBar_index); |
| 622 NSUInteger toolbar_index = | 622 NSUInteger toolbar_index = |
| 623 [subviews indexOfObject:[controller_ toolbarView]]; | 623 [subviews indexOfObject:[controller_ toolbarView]]; |
| 624 EXPECT_NE(NSNotFound, toolbar_index); | 624 EXPECT_NE(NSNotFound, toolbar_index); |
| 625 NSUInteger bookmark_index = | 625 NSUInteger bookmark_index = |
| 626 [subviews indexOfObject:[controller_ bookmarkView]]; | 626 [subviews indexOfObject:[controller_ bookmarkView]]; |
| 627 EXPECT_NE(NSNotFound, bookmark_index); | 627 EXPECT_NE(NSNotFound, bookmark_index); |
| 628 | 628 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 testFullscreenWindow_.reset( | 879 testFullscreenWindow_.reset( |
| 880 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) | 880 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) |
| 881 styleMask:NSBorderlessWindowMask | 881 styleMask:NSBorderlessWindowMask |
| 882 backing:NSBackingStoreBuffered | 882 backing:NSBackingStoreBuffered |
| 883 defer:NO]); | 883 defer:NO]); |
| 884 return testFullscreenWindow_.get(); | 884 return testFullscreenWindow_.get(); |
| 885 } | 885 } |
| 886 @end | 886 @end |
| 887 | 887 |
| 888 /* TODO(???): test other methods of BrowserWindowController */ | 888 /* TODO(???): test other methods of BrowserWindowController */ |
| OLD | NEW |