| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex]; | 145 NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex]; |
| 146 EXPECT_EQ([window firstResponder], [(id)locationBar currentEditor]); | 146 EXPECT_EQ([window firstResponder], [(id)locationBar currentEditor]); |
| 147 } | 147 } |
| 148 | 148 |
| 149 // TODO(dmaclach) disabled due to crash: crbug.com/27920 | 149 // TODO(dmaclach) disabled due to crash: crbug.com/27920 |
| 150 // Test drawing, mostly to ensure nothing leaks or crashes. | 150 // Test drawing, mostly to ensure nothing leaks or crashes. |
| 151 TEST_F(ToolbarControllerTest, DISABLED_Display) { | 151 TEST_F(ToolbarControllerTest, DISABLED_Display) { |
| 152 [[bar_ view] display]; | 152 [[bar_ view] display]; |
| 153 } | 153 } |
| 154 | 154 |
| 155 TEST_F(ToolbarControllerTest, LoadingState) { | 155 // TODO(dmaclach) disabled due to crash: crbug.com/27920 |
| 156 TEST_F(ToolbarControllerTest, DISABLED_LoadingState) { |
| 156 // TODO(pinkerton): Same problem testing this as the starred state above. | 157 // TODO(pinkerton): Same problem testing this as the starred state above. |
| 157 | 158 |
| 158 // In its initial state, the go button has a tag of IDC_GO. When loading, | 159 // In its initial state, the go button has a tag of IDC_GO. When loading, |
| 159 // it should be IDC_STOP. | 160 // it should be IDC_STOP. |
| 160 NSButton* go = [[bar_ toolbarViews] objectAtIndex:kGoIndex]; | 161 NSButton* go = [[bar_ toolbarViews] objectAtIndex:kGoIndex]; |
| 161 EXPECT_EQ([go tag], IDC_GO); | 162 EXPECT_EQ([go tag], IDC_GO); |
| 162 [bar_ setIsLoading:YES]; | 163 [bar_ setIsLoading:YES]; |
| 163 EXPECT_EQ([go tag], IDC_STOP); | 164 EXPECT_EQ([go tag], IDC_STOP); |
| 164 [bar_ setIsLoading:NO]; | 165 [bar_ setIsLoading:NO]; |
| 165 EXPECT_EQ([go tag], IDC_GO); | 166 EXPECT_EQ([go tag], IDC_GO); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 299 } |
| 299 | 300 |
| 300 TEST_F(ToolbarControllerTest, HeightCompression) { | 301 TEST_F(ToolbarControllerTest, HeightCompression) { |
| 301 for (int i = 0; i <= 10; i++) { | 302 for (int i = 0; i <= 10; i++) { |
| 302 [bar_ setHeightCompression:static_cast<CGFloat>(i)]; | 303 [bar_ setHeightCompression:static_cast<CGFloat>(i)]; |
| 303 EXPECT_EQ(static_cast<CGFloat>(36 - i), [resizeDelegate_ height]); | 304 EXPECT_EQ(static_cast<CGFloat>(36 - i), [resizeDelegate_ height]); |
| 304 } | 305 } |
| 305 } | 306 } |
| 306 | 307 |
| 307 } // namespace | 308 } // namespace |
| OLD | NEW |