Commit 1d26af5e authored by Yoshifumi Inoue's avatar Yoshifumi Inoue Committed by Commit Bot

[NGFragmentItem] Utilize NGInlineCursor in NGBoxFragmentPainterTest.ScrollHitTestOrder

This patch changes |NGBoxFragmentPainterTest.ScrollHitTestOrder| to use
|NGInlineCursor| to handle both |NGFragmentItem| and |NGPaintFragment| for
preparation of migrating |NGFragmentItem|.

Bug: 982194
Change-Id: Ib3a706aa3e1bc5d81009e22bf1002eb60eea55a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108265
Auto-Submit: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751263}
parent 43447321
...@@ -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"
...@@ -44,9 +45,15 @@ TEST_P(NGBoxFragmentPainterTest, ScrollHitTestOrder) { ...@@ -44,9 +45,15 @@ TEST_P(NGBoxFragmentPainterTest, ScrollHitTestOrder) {
)HTML"); )HTML");
auto& scroller = ToLayoutBox(*GetLayoutObjectByElementId("scroller")); auto& scroller = ToLayoutBox(*GetLayoutObjectByElementId("scroller"));
const NGPaintFragment& root_fragment = *scroller.PaintFragment(); const DisplayItemClient& root_fragment =
const NGPaintFragment& line_box_fragment = *root_fragment.FirstChild(); scroller.PaintFragment()
const NGPaintFragment& text_fragment = *line_box_fragment.FirstChild(); ? static_cast<const DisplayItemClient&>(*scroller.PaintFragment())
: static_cast<const DisplayItemClient&>(scroller);
NGInlineCursor cursor;
cursor.MoveTo(*scroller.SlowFirstChild());
const DisplayItemClient& text_fragment =
*cursor.Current().GetDisplayItemClient();
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