Commit fc379556 authored by pilgrim's avatar pilgrim Committed by Commit bot

[Layout API] Use API shim in LayoutObjectTest

As this test resides in core/layout/ and is directly testing the
layout object itself, there's no particular reason to rewrite it to
route everything through the block layout API. The only reason it would
come up is that it relies on Document::layoutView(), which is being
replaced in other code with Document::layoutViewItem().

Instead, I'm going to poke through the API and allow this privileged
code to access the underlying layout object.

There are no functional changes.

BUG=499321

Review-Url: https://codereview.chromium.org/2127923003
Cr-Commit-Position: refs/heads/master@{#403934}
parent 2e7bdc10
......@@ -6,6 +6,7 @@
#include "core/layout/LayoutTestHelper.h"
#include "core/layout/LayoutView.h"
#include "core/layout/api/LayoutAPIShim.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
......@@ -15,7 +16,7 @@ public:
LayoutObjectTest()
: RenderingTest(SingleChildFrameLoaderClient::create()) {}
protected:
LayoutView& layoutView() const { return *document().layoutView(); }
LayoutView& layoutView() const { return *toLayoutView(LayoutAPIShim::layoutObjectFrom(document().layoutViewItem())); }
};
TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject)
......
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