Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: chrome/browser/cocoa/toolbar_controller_unittest.mm

Issue 160496: Implement back/forward toolbar menus on Mac.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 CommandUpdater* updater = browser->command_updater(); 31 CommandUpdater* updater = browser->command_updater();
32 // The default state for the commands is true, set a couple to false to 32 // The default state for the commands is true, set a couple to false to
33 // ensure they get picked up correct on initialization 33 // ensure they get picked up correct on initialization
34 updater->UpdateCommandEnabled(IDC_BACK, false); 34 updater->UpdateCommandEnabled(IDC_BACK, false);
35 updater->UpdateCommandEnabled(IDC_FORWARD, false); 35 updater->UpdateCommandEnabled(IDC_FORWARD, false);
36 resizeDelegate_.reset([[ViewResizerPong alloc] init]); 36 resizeDelegate_.reset([[ViewResizerPong alloc] init]);
37 bar_.reset( 37 bar_.reset(
38 [[ToolbarController alloc] initWithModel:browser->toolbar_model() 38 [[ToolbarController alloc] initWithModel:browser->toolbar_model()
39 commands:browser->command_updater() 39 commands:browser->command_updater()
40 profile:helper_.profile() 40 profile:helper_.profile()
41 browser:browser
41 resizeDelegate:resizeDelegate_.get() 42 resizeDelegate:resizeDelegate_.get()
42 bookmarkDelegate:nil]); 43 bookmarkDelegate:nil]);
43 EXPECT_TRUE([bar_ view]); 44 EXPECT_TRUE([bar_ view]);
44 NSView* parent = [cocoa_helper_.window() contentView]; 45 NSView* parent = [cocoa_helper_.window() contentView];
45 [parent addSubview:[bar_ view]]; 46 [parent addSubview:[bar_ view]];
46 } 47 }
47 48
48 // Make sure the enabled state of the view is the same as the corresponding 49 // Make sure the enabled state of the view is the same as the corresponding
49 // command in the updater. The views are in the declaration order of outlets. 50 // command in the updater. The views are in the declaration order of outlets.
50 void CompareState(CommandUpdater* updater, NSArray* views) { 51 void CompareState(CommandUpdater* updater, NSArray* views) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 EXPECT_EQ(39, [resizeDelegate_ height]); 209 EXPECT_EQ(39, [resizeDelegate_ height]);
209 EXPECT_EQ(5, NSHeight([bookmarkBarView frame])); 210 EXPECT_EQ(5, NSHeight([bookmarkBarView frame]));
210 211
211 // Resize the bookmarkbar to 6px. Toolbar should grow to 40px. 212 // Resize the bookmarkbar to 6px. Toolbar should grow to 40px.
212 [bar_ resizeView:bookmarkBarView newHeight:6]; 213 [bar_ resizeView:bookmarkBarView newHeight:6];
213 EXPECT_EQ(40, [resizeDelegate_ height]); 214 EXPECT_EQ(40, [resizeDelegate_ height]);
214 EXPECT_EQ(6, NSHeight([bookmarkBarView frame])); 215 EXPECT_EQ(6, NSHeight([bookmarkBarView frame]));
215 } 216 }
216 217
217 } // namespace 218 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/toolbar_controller.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698