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/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutTestHelper.h" | 8 #include "core/layout/LayoutTestHelper.h" |
9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
10 #include "platform/json/JSONValues.h" | 10 #include "platform/json/JSONValues.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class LayoutObjectTest : public RenderingTest { | 15 class LayoutObjectTest : public RenderingTest { |
16 public: | 16 public: |
17 LayoutObjectTest() : RenderingTest(SingleChildFrameLoaderClient::create()) {} | 17 LayoutObjectTest() : RenderingTest(EmptyFrameLoaderClient::create()) {} |
18 }; | 18 }; |
19 | 19 |
20 TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject) { | 20 TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject) { |
21 setBodyInnerHTML("<div id='div' style='position: fixed'>test</div>"); | 21 setBodyInnerHTML("<div id='div' style='position: fixed'>test</div>"); |
22 Element* div = document().getElementById(AtomicString("div")); | 22 Element* div = document().getElementById(AtomicString("div")); |
23 ASSERT(div); | 23 ASSERT(div); |
24 LayoutObject* obj = div->layoutObject(); | 24 LayoutObject* obj = div->layoutObject(); |
25 ASSERT(obj); | 25 ASSERT(obj); |
26 EXPECT_STREQ("LayoutBlockFlow (positioned)", | 26 EXPECT_STREQ("LayoutBlockFlow (positioned)", |
27 obj->decoratedName().ascii().data()); | 27 obj->decoratedName().ascii().data()); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 " </div>" | 118 " </div>" |
119 "</div>"); | 119 "</div>"); |
120 | 120 |
121 LayoutObject* overflowClipObject = | 121 LayoutObject* overflowClipObject = |
122 getLayoutObjectByElementId("overflow-clip-layer"); | 122 getLayoutObjectByElementId("overflow-clip-layer"); |
123 LayoutBlock* columns = toLayoutBlock(getLayoutObjectByElementId("columns")); | 123 LayoutBlock* columns = toLayoutBlock(getLayoutObjectByElementId("columns")); |
124 EXPECT_EQ(columns->layer(), overflowClipObject->paintingLayer()); | 124 EXPECT_EQ(columns->layer(), overflowClipObject->paintingLayer()); |
125 } | 125 } |
126 | 126 |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |