Index: ui/gfx/paint_vector_icon_unittest.cc |
diff --git a/ui/gfx/paint_vector_icon_unittest.cc b/ui/gfx/paint_vector_icon_unittest.cc |
index 6786bf12d0187affcaf2952c4352264efdd1f08e..1adbb3fe3c8f14603d8020eeb83756871b73debd 100644 |
--- a/ui/gfx/paint_vector_icon_unittest.cc |
+++ b/ui/gfx/paint_vector_icon_unittest.cc |
@@ -7,6 +7,8 @@ |
#include <gtest/gtest.h> |
#include <vector> |
+#include "cc/paint/paint_record.h" |
+#include "cc/paint/paint_recorder.h" |
#include "third_party/skia/include/core/SkCanvas.h" |
#include "third_party/skia/include/core/SkPath.h" |
#include "ui/gfx/canvas.h" |
@@ -36,8 +38,8 @@ class MockCanvas : public SkCanvas { |
// Tests that a relative move to command (R_MOVE_TO) after a close command |
// (CLOSE) uses the correct starting point. See crbug.com/697497 |
TEST(VectorIconTest, RelativeMoveToAfterClose) { |
- MockCanvas mock(100, 100); |
- Canvas canvas(&mock, 1.0f); |
+ cc::PaintRecorder recorder; |
+ Canvas canvas(recorder.beginRecording(100, 100), 1.0f); |
const PathElement elements[] = { |
MOVE_TO, 4, 5, |
@@ -51,6 +53,11 @@ TEST(VectorIconTest, RelativeMoveToAfterClose) { |
const VectorIcon icon = {elements, nullptr}; |
PaintVectorIcon(&canvas, icon, 100, SK_ColorMAGENTA); |
+ sk_sp<cc::PaintRecord> record = recorder.finishRecordingAsPicture(); |
+ |
+ MockCanvas mock(100, 100); |
+ record->playback(&mock); |
+ |
ASSERT_EQ(1U, mock.paths().size()); |
SkPoint last_point; |
EXPECT_TRUE(mock.paths()[0].getLastPt(&last_point)); |