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

Side by Side Diff: chrome/browser/ui/toolbar/wrench_icon_painter_unittest.cc

Issue 1105373002: Add task runners to more tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FirstRunBubbleTest.CreateAndClose Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h" 5 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h"
6 6
7 #include "base/message_loop/message_loop.h"
8 #include "chrome/browser/themes/theme_service.h" 7 #include "chrome/browser/themes/theme_service.h"
9 #include "chrome/browser/themes/theme_service_factory.h" 8 #include "chrome/browser/themes/theme_service_factory.h"
10 #include "chrome/test/base/testing_profile.h" 9 #include "chrome/test/base/testing_profile.h"
10 #include "content/public/test/test_browser_thread_bundle.h"
11 #include "grit/theme_resources.h" 11 #include "grit/theme_resources.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/gfx/canvas.h" 13 #include "ui/gfx/canvas.h"
14 #include "ui/gfx/geometry/rect.h" 14 #include "ui/gfx/geometry/rect.h"
15 15
16 class WrenchIconPainterTest : public testing::Test, 16 class WrenchIconPainterTest : public testing::Test,
17 public WrenchIconPainter::Delegate { 17 public WrenchIconPainter::Delegate {
18 public: 18 public:
19 WrenchIconPainterTest() : schedule_paint_count_(0), painter_(this) { 19 WrenchIconPainterTest() : schedule_paint_count_(0), painter_(this) {
20 theme_provider_ = ThemeServiceFactory::GetForProfile(&profile_); 20 theme_provider_ = ThemeServiceFactory::GetForProfile(&profile_);
21 } 21 }
22 22
23 void ScheduleWrenchIconPaint() override { ++schedule_paint_count_; } 23 void ScheduleWrenchIconPaint() override { ++schedule_paint_count_; }
24 24
25 protected: 25 protected:
26 base::MessageLoopForUI message_loop_; // Needed for gfx::Animation. 26 // Needed for gfx::Animation and the testing profile.
27 content::TestBrowserThreadBundle thread_bundle_;
27 TestingProfile profile_; 28 TestingProfile profile_;
28 int schedule_paint_count_; 29 int schedule_paint_count_;
29 ui::ThemeProvider* theme_provider_; 30 ui::ThemeProvider* theme_provider_;
30 WrenchIconPainter painter_; 31 WrenchIconPainter painter_;
31 32
32 private: 33 private:
33 DISALLOW_COPY_AND_ASSIGN(WrenchIconPainterTest); 34 DISALLOW_COPY_AND_ASSIGN(WrenchIconPainterTest);
34 }; 35 };
35 36
36 // Nothing to test here. Just exercise the paint code to verify that nothing 37 // Nothing to test here. Just exercise the paint code to verify that nothing
(...skipping 22 matching lines...) Expand all
59 painter_.Paint( 60 painter_.Paint(
60 &canvas, theme_provider_, rect, WrenchIconPainter::BEZEL_PRESSED); 61 &canvas, theme_provider_, rect, WrenchIconPainter::BEZEL_PRESSED);
61 } 62 }
62 63
63 TEST_F(WrenchIconPainterTest, PaintCallback) { 64 TEST_F(WrenchIconPainterTest, PaintCallback) {
64 painter_.SetSeverity(WrenchIconPainter::SEVERITY_LOW, true); 65 painter_.SetSeverity(WrenchIconPainter::SEVERITY_LOW, true);
65 schedule_paint_count_ = 0; 66 schedule_paint_count_ = 0;
66 painter_.AnimationProgressed(NULL); 67 painter_.AnimationProgressed(NULL);
67 EXPECT_EQ(1, schedule_paint_count_); 68 EXPECT_EQ(1, schedule_paint_count_);
68 } 69 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/task_manager_mac_unittest.mm ('k') | chrome/browser/ui/views/first_run_bubble_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698