| 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 #include "base/mac/scoped_nsobject.h" | 5 #include "base/mac/scoped_nsobject.h" |
| 6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 7 #import "chrome/browser/ui/cocoa/image_button_cell.h" | 7 #import "chrome/browser/ui/cocoa/image_button_cell.h" |
| 8 #include "chrome/grit/theme_resources.h" | 8 #include "chrome/grit/theme_resources.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 [[view_ cell] setEnabled:NO]; | 72 [[view_ cell] setEnabled:NO]; |
| 73 [view_ display]; | 73 [view_ display]; |
| 74 | 74 |
| 75 // Unset the disabled image and draw. | 75 // Unset the disabled image and draw. |
| 76 [[view_ cell] setImageID:0 | 76 [[view_ cell] setImageID:0 |
| 77 forButtonState:image_button_cell::kDisabledState]; | 77 forButtonState:image_button_cell::kDisabledState]; |
| 78 [view_ display]; | 78 [view_ display]; |
| 79 } | 79 } |
| 80 | 80 |
| 81 TEST_F(ImageButtonCellTest, NewImageCausesDisplay) { | 81 TEST_F(ImageButtonCellTest, NewImageCausesDisplay) { |
| 82 [[view_ cell] setImageID:IDR_STOP | 82 [[view_ cell] setImageID:IDR_FORWARD |
| 83 forButtonState:image_button_cell::kDefaultState]; | 83 forButtonState:image_button_cell::kDefaultState]; |
| 84 [view_ display]; | 84 [view_ display]; |
| 85 EXPECT_FALSE([view_ needsDisplay]); | 85 EXPECT_FALSE([view_ needsDisplay]); |
| 86 | 86 |
| 87 [[view_ cell] setImageID:IDR_RELOAD | 87 [[view_ cell] setImageID:IDR_FORWARD_D |
| 88 forButtonState:image_button_cell::kDefaultState]; | 88 forButtonState:image_button_cell::kDefaultState]; |
| 89 EXPECT_TRUE([view_ needsDisplay]); | 89 EXPECT_TRUE([view_ needsDisplay]); |
| 90 } | 90 } |
| 91 | 91 |
| 92 } // namespace | 92 } // namespace |
| OLD | NEW |