| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 class ToolbarControllerTest : public PlatformTest { | 40 class ToolbarControllerTest : public PlatformTest { |
| 41 public: | 41 public: |
| 42 | 42 |
| 43 // Indexes that match the ordering returned by the private ToolbarController | 43 // Indexes that match the ordering returned by the private ToolbarController |
| 44 // |-toolbarViews| method. | 44 // |-toolbarViews| method. |
| 45 enum { | 45 enum { |
| 46 kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, kStarIndex, kGoIndex, | 46 kBackIndex, kForwardIndex, kReloadIndex, kHomeIndex, kStarIndex, kGoIndex, |
| 47 kPageIndex, kWrenchIndex, kLocationIndex, kEncodingMenuIndex | 47 kPageIndex, kWrenchIndex, kLocationIndex, kEncodingMenuIndex, |
| 48 kBrowserActionContainerViewIndex |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 ToolbarControllerTest() { | 51 ToolbarControllerTest() { |
| 51 Browser* browser = helper_.browser(); | 52 Browser* browser = helper_.browser(); |
| 52 CommandUpdater* updater = browser->command_updater(); | 53 CommandUpdater* updater = browser->command_updater(); |
| 53 // The default state for the commands is true, set a couple to false to | 54 // The default state for the commands is true, set a couple to false to |
| 54 // ensure they get picked up correct on initialization | 55 // ensure they get picked up correct on initialization |
| 55 updater->UpdateCommandEnabled(IDC_BACK, false); | 56 updater->UpdateCommandEnabled(IDC_BACK, false); |
| 56 updater->UpdateCommandEnabled(IDC_FORWARD, false); | 57 updater->UpdateCommandEnabled(IDC_FORWARD, false); |
| 57 resizeDelegate_.reset([[ViewResizerPong alloc] init]); | 58 resizeDelegate_.reset([[ViewResizerPong alloc] init]); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 [bar_ setShouldBeCompressed:YES]; | 300 [bar_ setShouldBeCompressed:YES]; |
| 300 EXPECT_EQ(30.0, [resizeDelegate_ height]); | 301 EXPECT_EQ(30.0, [resizeDelegate_ height]); |
| 301 } | 302 } |
| 302 | 303 |
| 303 TEST_F(ToolbarControllerTest, CorrectHeightWhenUnompressed) { | 304 TEST_F(ToolbarControllerTest, CorrectHeightWhenUnompressed) { |
| 304 [bar_ setShouldBeCompressed:NO]; | 305 [bar_ setShouldBeCompressed:NO]; |
| 305 EXPECT_EQ(36.0, [resizeDelegate_ height]); | 306 EXPECT_EQ(36.0, [resizeDelegate_ height]); |
| 306 } | 307 } |
| 307 | 308 |
| 308 } // namespace | 309 } // namespace |
| OLD | NEW |