| Index: ui/views/controls/label_unittest.cc
|
| diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc
|
| index 32fabd783a5968587a403bdd5259a2890813286f..47cb37ae44a3dc0b65852b6dd462d5e4b09beeb6 100644
|
| --- a/ui/views/controls/label_unittest.cc
|
| +++ b/ui/views/controls/label_unittest.cc
|
| @@ -9,7 +9,7 @@
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "ui/accessibility/ax_view_state.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| -#include "ui/compositor/paint_context.h"
|
| +#include "ui/compositor/canvas_painter.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/views/border.h"
|
| #include "ui/views/test/focus_manager_test.h"
|
| @@ -305,14 +305,14 @@ TEST_F(LabelTest, TextChangeWithoutLayout) {
|
| label.SetBounds(0, 0, 200, 200);
|
|
|
| gfx::Canvas canvas(gfx::Size(200, 200), 1.0f, true);
|
| - label.Paint(ui::PaintContext(&canvas));
|
| + label.Paint(ui::CanvasPainter(&canvas, 1.f).context());
|
| EXPECT_EQ(1u, label.lines_.size());
|
| EXPECT_EQ(ASCIIToUTF16("Example"), label.lines_[0]->GetDisplayText());
|
|
|
| label.SetText(ASCIIToUTF16("Altered"));
|
| // The altered text should be painted even though Layout() or SetBounds() are
|
| // not called.
|
| - label.Paint(ui::PaintContext(&canvas));
|
| + label.Paint(ui::CanvasPainter(&canvas, 1.f).context());
|
| EXPECT_EQ(1u, label.lines_.size());
|
| EXPECT_EQ(ASCIIToUTF16("Altered"), label.lines_[0]->GetDisplayText());
|
| }
|
| @@ -482,7 +482,7 @@ TEST_F(LabelTest, MultiLineSizingWithElide) {
|
|
|
| // Paint() doesn't change the preferred size.
|
| gfx::Canvas canvas;
|
| - label.Paint(ui::PaintContext(&canvas));
|
| + label.Paint(ui::CanvasPainter(&canvas, 1.f).context());
|
| EXPECT_EQ(narrow_size.ToString(), label.GetPreferredSize().ToString());
|
| }
|
|
|
| @@ -555,7 +555,7 @@ TEST_F(LabelTest, ResetRenderTextData) {
|
| EXPECT_EQ(0u, label.lines_.size());
|
|
|
| gfx::Canvas canvas(preferred_size, 1.0f, true);
|
| - label.Paint(ui::PaintContext(&canvas));
|
| + label.Paint(ui::CanvasPainter(&canvas, 1.f).context());
|
| EXPECT_EQ(1u, label.lines_.size());
|
|
|
| // Label should recreate its RenderText object when it's invisible, to release
|
| @@ -575,14 +575,14 @@ TEST_F(LabelTest, ResetRenderTextData) {
|
| label.SetVisible(true);
|
| EXPECT_EQ(0u, label.lines_.size());
|
|
|
| - label.Paint(ui::PaintContext(&canvas));
|
| + label.Paint(ui::CanvasPainter(&canvas, 1.f).context());
|
| EXPECT_EQ(1u, label.lines_.size());
|
|
|
| // Changing layout just resets |lines_|. It'll recover next time it's drawn.
|
| label.SetBounds(0, 0, 10, 10);
|
| EXPECT_EQ(0u, label.lines_.size());
|
|
|
| - label.Paint(ui::PaintContext(&canvas));
|
| + label.Paint(ui::CanvasPainter(&canvas, 1.f).context());
|
| EXPECT_EQ(1u, label.lines_.size());
|
| }
|
|
|
| @@ -597,7 +597,7 @@ TEST_F(LabelTest, MultilineSupportedRenderText) {
|
| label.SizeToPreferredSize();
|
|
|
| gfx::Canvas canvas(label.GetPreferredSize(), 1.0f, true);
|
| - label.Paint(ui::PaintContext(&canvas));
|
| + label.Paint(ui::CanvasPainter(&canvas, 1.f).context());
|
|
|
| // There's only one 'line', RenderText itself supports multiple lines.
|
| EXPECT_EQ(1u, label.lines_.size());
|
|
|