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

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

Issue 630002: Allow the Mac theme provider to give default colors/tints if requested. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: merge Created 10 years, 10 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
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 #include "app/theme_provider.h" 7 #include "app/theme_provider.h"
8 #include "base/scoped_nsobject.h" 8 #include "base/scoped_nsobject.h"
9 #include "chrome/browser/browser_theme_provider.h" 9 #include "chrome/browser/browser_theme_provider.h"
10 #import "chrome/browser/cocoa/bookmark_bar_controller.h" 10 #import "chrome/browser/cocoa/bookmark_bar_controller.h"
(...skipping 17 matching lines...) Expand all
28 // Cross platform methods 28 // Cross platform methods
29 MOCK_METHOD1(Init, void(Profile*)); 29 MOCK_METHOD1(Init, void(Profile*));
30 MOCK_CONST_METHOD1(GetBitmapNamed, SkBitmap*(int)); 30 MOCK_CONST_METHOD1(GetBitmapNamed, SkBitmap*(int));
31 MOCK_CONST_METHOD1(GetColor, SkColor(int)); 31 MOCK_CONST_METHOD1(GetColor, SkColor(int));
32 MOCK_CONST_METHOD2(GetDisplayProperty, bool(int, int*)); 32 MOCK_CONST_METHOD2(GetDisplayProperty, bool(int, int*));
33 MOCK_CONST_METHOD0(ShouldUseNativeFrame, bool()); 33 MOCK_CONST_METHOD0(ShouldUseNativeFrame, bool());
34 MOCK_CONST_METHOD1(HasCustomImage, bool(int)); 34 MOCK_CONST_METHOD1(HasCustomImage, bool(int));
35 MOCK_CONST_METHOD1(GetRawData, RefCountedMemory*(int)); 35 MOCK_CONST_METHOD1(GetRawData, RefCountedMemory*(int));
36 36
37 // OSX stuff 37 // OSX stuff
38 MOCK_CONST_METHOD1(GetNSImageNamed, NSImage*(int)); 38 MOCK_CONST_METHOD2(GetNSImageNamed, NSImage*(int, bool));
39 MOCK_CONST_METHOD1(GetNSColor, NSColor*(int)); 39 MOCK_CONST_METHOD2(GetNSColor, NSColor*(int, bool));
40 MOCK_CONST_METHOD1(GetNSColorTint, NSColor*(int)); 40 MOCK_CONST_METHOD2(GetNSColorTint, NSColor*(int, bool));
41 }; 41 };
42 42
43 // Allows us to inject our fake controller below. 43 // Allows us to inject our fake controller below.
44 @interface BookmarkBarToolbarView (TestingAPI) 44 @interface BookmarkBarToolbarView (TestingAPI)
45 -(void)setController:(id<BookmarkBarToolbarViewController>)controller; 45 -(void)setController:(id<BookmarkBarToolbarViewController>)controller;
46 @end 46 @end
47 47
48 @implementation BookmarkBarToolbarView (TestingAPI) 48 @implementation BookmarkBarToolbarView (TestingAPI)
49 -(void)setController:(id<BookmarkBarToolbarViewController>)controller { 49 -(void)setController:(id<BookmarkBarToolbarViewController>)controller {
50 controller_ = controller; 50 controller_ = controller;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 EXPECT_CALL(provider, GetBitmapNamed(IDR_THEME_NTP_BACKGROUND)) 180 EXPECT_CALL(provider, GetBitmapNamed(IDR_THEME_NTP_BACKGROUND))
181 .WillRepeatedly(Return(&fake_bg)); 181 .WillRepeatedly(Return(&fake_bg));
182 182
183 [controller_.get() setThemeProvider:&provider]; 183 [controller_.get() setThemeProvider:&provider];
184 [controller_.get() setCurrentTabContentsHeight:200]; 184 [controller_.get() setCurrentTabContentsHeight:200];
185 185
186 [view_ display]; 186 [view_ display];
187 } 187 }
188 188
189 // TODO(viettrungluu): write more unit tests, especially after my refactoring. 189 // TODO(viettrungluu): write more unit tests, especially after my refactoring.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698