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

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

Issue 402066: Moved a whole pile of unittests over to CocoaTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/throbber_view_unittest.mm ('k') | chrome/browser/cocoa/toolbar_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698