Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp

Issue 2127923003: [Layout API] Use API shim in LayoutObjectTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698