Commit f2a782dc authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

[NGFragmentItem] Utilize NGInlineCursor in NGTextFragmentPainterTest.TestTextStyle

This patch changes |NGTextFragmentPainterTest.TestTextStyle| to use
|NGInlineCursor| to handle both |NGFragmentItem| and |NGPaintFragment| for
prepearation of migrating |NGFragmentItem|.

Bug: 982194
Change-Id: If78b7eadb10dcc17e65139f2c134607917b04752
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105269Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751259}
parent 95740b37
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h"
#include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h" #include "third_party/blink/renderer/core/layout/ng/layout_ng_block_flow.h"
#include "third_party/blink/renderer/core/layout/ng/ng_block_node.h" #include "third_party/blink/renderer/core/layout/ng/ng_block_node.h"
#include "third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h" #include "third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h"
...@@ -43,11 +44,10 @@ TEST_P(NGTextFragmentPainterTest, TestTextStyle) { ...@@ -43,11 +44,10 @@ TEST_P(NGTextFragmentPainterTest, TestTextStyle) {
DocumentUpdateReason::kTest); DocumentUpdateReason::kTest);
Paint(IntRect(0, 0, 640, 480)); Paint(IntRect(0, 0, 640, 480));
const NGPaintFragment& root_fragment = *block_flow.PaintFragment(); NGInlineCursor cursor;
EXPECT_EQ(1u, root_fragment.Children().size()); cursor.MoveTo(*block_flow.FirstChild());
const NGPaintFragment& line_box_fragment = *root_fragment.FirstChild(); const DisplayItemClient& text_fragment =
EXPECT_EQ(1u, line_box_fragment.Children().size()); *cursor.Current().GetDisplayItemClient();
const NGPaintFragment& text_fragment = *line_box_fragment.FirstChild();
EXPECT_THAT(RootPaintController().GetDisplayItemList(), EXPECT_THAT(RootPaintController().GetDisplayItemList(),
ElementsAre(IsSameId(&ViewScrollingBackgroundClient(), ElementsAre(IsSameId(&ViewScrollingBackgroundClient(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment