| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/LayoutObject.h" | 5 #include "core/layout/LayoutObject.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutTestHelper.h" | 7 #include "core/layout/LayoutTestHelper.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/layout/api/LayoutAPIShim.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class LayoutObjectTest : public RenderingTest { | 14 class LayoutObjectTest : public RenderingTest { |
| 14 public: | 15 public: |
| 15 LayoutObjectTest() | 16 LayoutObjectTest() |
| 16 : RenderingTest(SingleChildFrameLoaderClient::create()) {} | 17 : RenderingTest(SingleChildFrameLoaderClient::create()) {} |
| 17 protected: | 18 protected: |
| 18 LayoutView& layoutView() const { return *document().layoutView(); } | 19 LayoutView& layoutView() const { return *toLayoutView(LayoutAPIShim::layoutO
bjectFrom(document().layoutViewItem())); } |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject) | 22 TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject) |
| 22 { | 23 { |
| 23 setBodyInnerHTML("<div id='div' style='position: fixed'>test</div>"); | 24 setBodyInnerHTML("<div id='div' style='position: fixed'>test</div>"); |
| 24 Element* div = document().getElementById(AtomicString("div")); | 25 Element* div = document().getElementById(AtomicString("div")); |
| 25 ASSERT(div); | 26 ASSERT(div); |
| 26 LayoutObject* obj = div->layoutObject(); | 27 LayoutObject* obj = div->layoutObject(); |
| 27 ASSERT(obj); | 28 ASSERT(obj); |
| 28 EXPECT_STREQ("LayoutBlockFlow (positioned)", obj->decoratedName().ascii().da
ta()); | 29 EXPECT_STREQ("LayoutBlockFlow (positioned)", obj->decoratedName().ascii().da
ta()); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 " <div id='overflow-clip-layer' style='height: 100px; overflow: hidde
n'></div>" | 118 " <div id='overflow-clip-layer' style='height: 100px; overflow: hidde
n'></div>" |
| 118 " </div>" | 119 " </div>" |
| 119 "</div>"); | 120 "</div>"); |
| 120 | 121 |
| 121 LayoutObject* overflowClipObject = getLayoutObjectByElementId("overflow-clip
-layer"); | 122 LayoutObject* overflowClipObject = getLayoutObjectByElementId("overflow-clip
-layer"); |
| 122 LayoutBlock* columns = toLayoutBlock(getLayoutObjectByElementId("columns")); | 123 LayoutBlock* columns = toLayoutBlock(getLayoutObjectByElementId("columns")); |
| 123 EXPECT_EQ(columns->layer(), overflowClipObject->paintingLayer()); | 124 EXPECT_EQ(columns->layer(), overflowClipObject->paintingLayer()); |
| 124 } | 125 } |
| 125 | 126 |
| 126 } // namespace blink | 127 } // namespace blink |
| OLD | NEW |