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

Unified Diff: chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc

Issue 1492423003: Rejigger ThemeService: move exposure of ThemeProvider interface to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a test Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc
diff --git a/chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc b/chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc
index a0fe0de5adab91cc2d173fc7bd5213048a886adf..9a47f0cfa6d76f60c4168e7c479513aafc6d887a 100644
--- a/chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc
+++ b/chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc
@@ -16,9 +16,10 @@
class AppMenuIconPainterTest : public testing::Test,
public AppMenuIconPainter::Delegate {
public:
- AppMenuIconPainterTest() : schedule_paint_count_(0), painter_(this) {
- theme_provider_ = ThemeServiceFactory::GetForProfile(&profile_);
- }
+ AppMenuIconPainterTest()
+ : schedule_paint_count_(0),
+ theme_provider_(ThemeService::GetThemeProviderForProfile(&profile_)),
+ painter_(this) {}
void ScheduleAppMenuIconPaint() override { ++schedule_paint_count_; }
@@ -27,7 +28,7 @@ class AppMenuIconPainterTest : public testing::Test,
content::TestBrowserThreadBundle thread_bundle_;
TestingProfile profile_;
int schedule_paint_count_;
- ui::ThemeProvider* theme_provider_;
+ const ui::ThemeProvider& theme_provider_;
AppMenuIconPainter painter_;
private:
@@ -40,25 +41,25 @@ TEST_F(AppMenuIconPainterTest, Paint) {
gfx::Rect rect(0, 0, 29, 29);
gfx::Canvas canvas(rect.size(), 1.0f, true);
- painter_.Paint(&canvas, theme_provider_, rect,
+ painter_.Paint(&canvas, &theme_provider_, rect,
AppMenuIconPainter::BEZEL_NONE);
- painter_.Paint(&canvas, theme_provider_, rect,
+ painter_.Paint(&canvas, &theme_provider_, rect,
AppMenuIconPainter::BEZEL_HOVER);
- painter_.Paint(&canvas, theme_provider_, rect,
+ painter_.Paint(&canvas, &theme_provider_, rect,
AppMenuIconPainter::BEZEL_PRESSED);
painter_.SetSeverity(AppMenuIconPainter::SEVERITY_LOW, true);
- painter_.Paint(&canvas, theme_provider_, rect,
+ painter_.Paint(&canvas, &theme_provider_, rect,
AppMenuIconPainter::BEZEL_PRESSED);
painter_.SetSeverity(AppMenuIconPainter::SEVERITY_MEDIUM, true);
- painter_.Paint(&canvas, theme_provider_, rect,
+ painter_.Paint(&canvas, &theme_provider_, rect,
AppMenuIconPainter::BEZEL_PRESSED);
painter_.SetSeverity(AppMenuIconPainter::SEVERITY_HIGH, true);
- painter_.Paint(&canvas, theme_provider_, rect,
+ painter_.Paint(&canvas, &theme_provider_, rect,
AppMenuIconPainter::BEZEL_PRESSED);
- painter_.set_badge(*theme_provider_->GetImageSkiaNamed(IDR_PRODUCT_LOGO_16));
- painter_.Paint(&canvas, theme_provider_, rect,
+ painter_.set_badge(*theme_provider_.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16));
+ painter_.Paint(&canvas, &theme_provider_, rect,
AppMenuIconPainter::BEZEL_PRESSED);
}

Powered by Google App Engine
This is Rietveld 408576698