| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 171 |
| 172 // Return the correct tiling/alignment information. | 172 // Return the correct tiling/alignment information. |
| 173 EXPECT_CALL(provider, | 173 EXPECT_CALL(provider, |
| 174 GetDisplayProperty(ThemeService::NTP_BACKGROUND_TILING, _)) | 174 GetDisplayProperty(ThemeService::NTP_BACKGROUND_TILING, _)) |
| 175 .WillRepeatedly(SetBackgroundTiling()); | 175 .WillRepeatedly(SetBackgroundTiling()); |
| 176 EXPECT_CALL(provider, | 176 EXPECT_CALL(provider, |
| 177 GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT, _)) | 177 GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT, _)) |
| 178 .WillRepeatedly(SetAlignLeft()); | 178 .WillRepeatedly(SetAlignLeft()); |
| 179 | 179 |
| 180 // Create a dummy bitmap full of not-red to blit with. | 180 // Create a dummy bitmap full of not-red to blit with. |
| 181 SkBitmap fake_bg; | 181 SkBitmap fake_bg_bitmap; |
| 182 fake_bg.setConfig(SkBitmap::kARGB_8888_Config, 800, 800); | 182 fake_bg_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 800, 800); |
| 183 fake_bg.allocPixels(); | 183 fake_bg_bitmap.allocPixels(); |
| 184 fake_bg.eraseColor(SK_ColorGREEN); | 184 fake_bg_bitmap.eraseColor(SK_ColorGREEN); |
| 185 EXPECT_CALL(provider, GetBitmapNamed(IDR_THEME_NTP_BACKGROUND)) | 185 gfx::ImageSkia fake_bg(fake_bg_bitmap); |
| 186 EXPECT_CALL(provider, GetImageSkiaNamed(IDR_THEME_NTP_BACKGROUND)) |
| 186 .WillRepeatedly(Return(&fake_bg)); | 187 .WillRepeatedly(Return(&fake_bg)); |
| 187 | 188 |
| 188 [controller_.get() setThemeProvider:&provider]; | 189 [controller_.get() setThemeProvider:&provider]; |
| 189 [controller_.get() setCurrentTabContentsHeight:200]; | 190 [controller_.get() setCurrentTabContentsHeight:200]; |
| 190 | 191 |
| 191 [view_ display]; | 192 [view_ display]; |
| 192 } | 193 } |
| 193 | 194 |
| 194 // TODO(viettrungluu): write more unit tests, especially after my refactoring. | 195 // TODO(viettrungluu): write more unit tests, especially after my refactoring. |
| OLD | NEW |