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

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

Issue 2374803002: Remove a bunch of pre-MD toolbar code and assets. (Closed)
Patch Set: Created 4 years, 3 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 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
deleted file mode 100644
index 1fdc03721c9e91272227f8d2f3ee2712d00c758f..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/toolbar/app_menu_icon_painter_unittest.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/toolbar/app_menu_icon_painter.h"
-
-#include "base/macros.h"
-#include "chrome/browser/themes/theme_service.h"
-#include "chrome/browser/themes/theme_service_factory.h"
-#include "chrome/grit/theme_resources.h"
-#include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_browser_thread_bundle.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/geometry/rect.h"
-
-class AppMenuIconPainterTest : public testing::Test,
- public AppMenuIconPainter::Delegate {
- public:
- AppMenuIconPainterTest()
- : schedule_paint_count_(0),
- theme_provider_(ThemeService::GetThemeProviderForProfile(&profile_)),
- painter_(this) {}
-
- void ScheduleAppMenuIconPaint() override { ++schedule_paint_count_; }
-
- protected:
- // Needed for gfx::Animation and the testing profile.
- content::TestBrowserThreadBundle thread_bundle_;
- TestingProfile profile_;
- int schedule_paint_count_;
- const ui::ThemeProvider& theme_provider_;
- AppMenuIconPainter painter_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(AppMenuIconPainterTest);
-};
-
-// Nothing to test here. Just exercise the paint code to verify that nothing
-// leaks or crashes.
-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,
- AppMenuIconPainter::BEZEL_NONE);
- painter_.Paint(&canvas, &theme_provider_, rect,
- AppMenuIconPainter::BEZEL_HOVER);
- painter_.Paint(&canvas, &theme_provider_, rect,
- AppMenuIconPainter::BEZEL_PRESSED);
-
- painter_.SetSeverity(AppMenuIconPainter::SEVERITY_LOW, true);
- painter_.Paint(&canvas, &theme_provider_, rect,
- AppMenuIconPainter::BEZEL_PRESSED);
- painter_.SetSeverity(AppMenuIconPainter::SEVERITY_MEDIUM, true);
- painter_.Paint(&canvas, &theme_provider_, rect,
- AppMenuIconPainter::BEZEL_PRESSED);
- painter_.SetSeverity(AppMenuIconPainter::SEVERITY_HIGH, true);
- 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,
- AppMenuIconPainter::BEZEL_PRESSED);
-}
-
-TEST_F(AppMenuIconPainterTest, PaintCallback) {
- painter_.SetSeverity(AppMenuIconPainter::SEVERITY_LOW, true);
- schedule_paint_count_ = 0;
- painter_.AnimationProgressed(NULL);
- EXPECT_EQ(1, schedule_paint_count_);
-}

Powered by Google App Engine
This is Rietveld 408576698