| 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 #import "base/scoped_nsobject.h" | 7 #import "base/scoped_nsobject.h" |
| 8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
| 9 #include "chrome/browser/cocoa/browser_test_helper.h" | 9 #include "chrome/browser/cocoa/browser_test_helper.h" |
| 10 #import "chrome/browser/cocoa/cocoa_test_helper.h" | 10 #import "chrome/browser/cocoa/cocoa_test_helper.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 [[views objectAtIndex:kStarIndex] isEnabled] ? true : false); | 82 [[views objectAtIndex:kStarIndex] isEnabled] ? true : false); |
| 83 } | 83 } |
| 84 | 84 |
| 85 BrowserTestHelper helper_; | 85 BrowserTestHelper helper_; |
| 86 scoped_nsobject<ViewResizerPong> resizeDelegate_; | 86 scoped_nsobject<ViewResizerPong> resizeDelegate_; |
| 87 scoped_nsobject<ToolbarController> bar_; | 87 scoped_nsobject<ToolbarController> bar_; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 TEST_VIEW(ToolbarControllerTest, [bar_ view]) | 90 TEST_VIEW(ToolbarControllerTest, [bar_ view]) |
| 91 | 91 |
| 92 ///////////////////////////////////////////////////////////////////// | |
| 93 // TODO(dmaclach) All tests disabled due to crashing: crbug.com/27920 | |
| 94 ///////////////////////////////////////////////////////////////////// | |
| 95 | |
| 96 // Test the initial state that everything is sync'd up | 92 // Test the initial state that everything is sync'd up |
| 97 TEST_F(ToolbarControllerTest, InitialState) { | 93 TEST_F(ToolbarControllerTest, InitialState) { |
| 98 CommandUpdater* updater = helper_.browser()->command_updater(); | 94 CommandUpdater* updater = helper_.browser()->command_updater(); |
| 99 CompareState(updater, [bar_ toolbarViews]); | 95 CompareState(updater, [bar_ toolbarViews]); |
| 100 } | 96 } |
| 101 | 97 |
| 102 // Make sure a "titlebar only" toolbar works | 98 // Make sure a "titlebar only" toolbar works |
| 103 TEST_F(ToolbarControllerTest, TitlebarOnly) { | 99 TEST_F(ToolbarControllerTest, TitlebarOnly) { |
| 104 NSView* view = [bar_ view]; | 100 NSView* view = [bar_ view]; |
| 105 | 101 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 293 } |
| 298 | 294 |
| 299 TEST_F(ToolbarControllerTest, HeightCompression) { | 295 TEST_F(ToolbarControllerTest, HeightCompression) { |
| 300 for (int i = 0; i <= 10; i++) { | 296 for (int i = 0; i <= 10; i++) { |
| 301 [bar_ setHeightCompression:static_cast<CGFloat>(i)]; | 297 [bar_ setHeightCompression:static_cast<CGFloat>(i)]; |
| 302 EXPECT_EQ(static_cast<CGFloat>(36 - i), [resizeDelegate_ height]); | 298 EXPECT_EQ(static_cast<CGFloat>(36 - i), [resizeDelegate_ height]); |
| 303 } | 299 } |
| 304 } | 300 } |
| 305 | 301 |
| 306 } // namespace | 302 } // namespace |
| OLD | NEW |