Commit 0b586147 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

Also accept LayoutNG objects in Layout{Block,Object}Test

R=ikilpatrick@chromium.org

Change-Id: I8671ab92cb0c043dc9a3dc3509d92586ee78779c
Reviewed-on: https://chromium-review.googlesource.com/c/1330829Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607067}
parent d64c807d
......@@ -5,11 +5,14 @@
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/layout/layout_block.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
#include "third_party/blink/renderer/platform/testing/runtime_enabled_features_test_helpers.h"
using ::testing::MatchesRegex;
namespace blink {
class LayoutBlockTest : public RenderingTest {};
......@@ -19,8 +22,8 @@ TEST_F(LayoutBlockTest, LayoutNameCalledWithNullStyle) {
LayoutObject* obj = LayoutBlockFlow::CreateAnonymous(&GetDocument(), style);
obj->SetStyleInternal(nullptr);
EXPECT_FALSE(obj->Style());
EXPECT_STREQ("LayoutBlockFlow (anonymous)",
obj->DecoratedName().Ascii().data());
EXPECT_THAT(obj->DecoratedName().Ascii().data(),
MatchesRegex("LayoutN?G?BlockFlow \\(anonymous\\)"));
obj->Destroy();
}
......
......@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
......@@ -22,6 +23,7 @@
namespace blink {
using testing::Return;
using testing::MatchesRegex;
class LayoutObjectTest : public RenderingTest {
public:
......@@ -54,8 +56,8 @@ TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject) {
DCHECK(div);
LayoutObject* obj = div->GetLayoutObject();
DCHECK(obj);
EXPECT_STREQ("LayoutBlockFlow (positioned)",
obj->DecoratedName().Ascii().data());
EXPECT_THAT(obj->DecoratedName().Ascii().data(),
MatchesRegex("LayoutN?G?BlockFlow \\(positioned\\)"));
}
// Some display checks.
......@@ -719,9 +721,9 @@ lime'>
StringBuilder result;
block->DumpLayoutObject(result, false, 0);
EXPECT_EQ(
result.ToString(),
String("LayoutBlockFlow\tDIV id=\"block\" style=\"background:\\nlime\""));
EXPECT_THAT(result.ToString().Utf8().data(),
MatchesRegex("LayoutN?G?BlockFlow\tDIV id=\"block\" "
"style=\"background:\\\\nlime\""));
result.Clear();
text->DumpLayoutObject(result, false, 0);
......
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