blob: e533d7f690e54e1918bf828b9e5a13dde273991e [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/paint/inline_text_box_painter.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/paint/paint_controller_paint_test.h"
using testing::ElementsAre;
namespace blink {
using InlineTextBoxPainterTest = PaintControllerPaintTest;
INSTANTIATE_PAINT_TEST_SUITE_P(InlineTextBoxPainterTest);
TEST_P(InlineTextBoxPainterTest, LineBreak) {
SetBodyInnerHTML("<span style='font-size: 20px'>A<br>B<br>C</span>");
// 0: view background, 1: A, 2: B, 3: C
EXPECT_EQ(4u, RootPaintController().GetDisplayItemList().size());
GetDocument().GetFrame()->Selection().SelectAll();
UpdateAllLifecyclePhasesForTest();
// 0: view background, 1: A, 2: <br>, 3: B, 4: <br>, 5: C
EXPECT_EQ(6u, RootPaintController().GetDisplayItemList().size());
}
} // namespace blink