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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
8 #include "chrome/browser/themes/theme_service.h" | 8 #include "chrome/browser/themes/theme_service.h" |
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class MockThemeProvider : public ui::ThemeProvider { | 28 class MockThemeProvider : public ui::ThemeProvider { |
29 public: | 29 public: |
30 // Cross platform methods | 30 // Cross platform methods |
31 MOCK_METHOD1(Init, void(Profile*)); | 31 MOCK_METHOD1(Init, void(Profile*)); |
32 MOCK_CONST_METHOD1(GetBitmapNamed, SkBitmap*(int)); | 32 MOCK_CONST_METHOD1(GetBitmapNamed, SkBitmap*(int)); |
33 MOCK_CONST_METHOD1(GetImageSkiaNamed, gfx::ImageSkia*(int)); | 33 MOCK_CONST_METHOD1(GetImageSkiaNamed, gfx::ImageSkia*(int)); |
34 MOCK_CONST_METHOD1(GetColor, SkColor(int)); | 34 MOCK_CONST_METHOD1(GetColor, SkColor(int)); |
35 MOCK_CONST_METHOD2(GetDisplayProperty, bool(int, int*)); | 35 MOCK_CONST_METHOD2(GetDisplayProperty, bool(int, int*)); |
36 MOCK_CONST_METHOD0(ShouldUseNativeFrame, bool()); | 36 MOCK_CONST_METHOD0(ShouldUseNativeFrame, bool()); |
37 MOCK_CONST_METHOD1(HasCustomImage, bool(int)); | 37 MOCK_CONST_METHOD1(HasCustomImage, bool(int)); |
38 MOCK_CONST_METHOD1(GetRawData, base::RefCountedMemory*(int)); | 38 MOCK_CONST_METHOD2(GetRawData, base::RefCountedMemory*(int, ui::ScaleFactor)); |
39 | 39 |
40 // OSX stuff | 40 // OSX stuff |
41 MOCK_CONST_METHOD2(GetNSImageNamed, NSImage*(int, bool)); | 41 MOCK_CONST_METHOD2(GetNSImageNamed, NSImage*(int, bool)); |
42 MOCK_CONST_METHOD2(GetNSImageColorNamed, NSColor*(int, bool)); | 42 MOCK_CONST_METHOD2(GetNSImageColorNamed, NSColor*(int, bool)); |
43 MOCK_CONST_METHOD2(GetNSColor, NSColor*(int, bool)); | 43 MOCK_CONST_METHOD2(GetNSColor, NSColor*(int, bool)); |
44 MOCK_CONST_METHOD2(GetNSColorTint, NSColor*(int, bool)); | 44 MOCK_CONST_METHOD2(GetNSColorTint, NSColor*(int, bool)); |
45 MOCK_CONST_METHOD1(GetNSGradient, NSGradient*(int)); | 45 MOCK_CONST_METHOD1(GetNSGradient, NSGradient*(int)); |
46 }; | 46 }; |
47 | 47 |
48 // Allows us to inject our fake controller below. | 48 // Allows us to inject our fake controller below. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 EXPECT_CALL(provider, GetImageSkiaNamed(IDR_THEME_NTP_BACKGROUND)) | 186 EXPECT_CALL(provider, GetImageSkiaNamed(IDR_THEME_NTP_BACKGROUND)) |
187 .WillRepeatedly(Return(&fake_bg)); | 187 .WillRepeatedly(Return(&fake_bg)); |
188 | 188 |
189 [controller_.get() setThemeProvider:&provider]; | 189 [controller_.get() setThemeProvider:&provider]; |
190 [controller_.get() setCurrentTabContentsHeight:200]; | 190 [controller_.get() setCurrentTabContentsHeight:200]; |
191 | 191 |
192 [view_ display]; | 192 [view_ display]; |
193 } | 193 } |
194 | 194 |
195 // TODO(viettrungluu): write more unit tests, especially after my refactoring. | 195 // TODO(viettrungluu): write more unit tests, especially after my refactoring. |
OLD | NEW |