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

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

Issue 2770123003: Replace ASSERT with DCHECK in core/layout/ excluding subdirs (Closed)
Patch Set: Split some DCHECKs and add DCHECK_ops wherever possible Created 3 years, 8 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
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/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 "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" 11 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class LayoutObjectTest : public RenderingTest { 16 class LayoutObjectTest : public RenderingTest {
17 public: 17 public:
18 LayoutObjectTest() : RenderingTest(EmptyLocalFrameClient::create()) {} 18 LayoutObjectTest() : RenderingTest(EmptyLocalFrameClient::create()) {}
19 }; 19 };
20 20
21 TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject) { 21 TEST_F(LayoutObjectTest, LayoutDecoratedNameCalledWithPositionedObject) {
22 setBodyInnerHTML("<div id='div' style='position: fixed'>test</div>"); 22 setBodyInnerHTML("<div id='div' style='position: fixed'>test</div>");
23 Element* div = document().getElementById(AtomicString("div")); 23 Element* div = document().getElementById(AtomicString("div"));
24 ASSERT(div); 24 DCHECK(div);
25 LayoutObject* obj = div->layoutObject(); 25 LayoutObject* obj = div->layoutObject();
26 ASSERT(obj); 26 DCHECK(obj);
27 EXPECT_STREQ("LayoutBlockFlow (positioned)", 27 EXPECT_STREQ("LayoutBlockFlow (positioned)",
28 obj->decoratedName().ascii().data()); 28 obj->decoratedName().ascii().data());
29 } 29 }
30 30
31 // Some display checks. 31 // Some display checks.
32 TEST_F(LayoutObjectTest, DisplayNoneCreateObject) { 32 TEST_F(LayoutObjectTest, DisplayNoneCreateObject) {
33 setBodyInnerHTML("<div style='display:none'></div>"); 33 setBodyInnerHTML("<div style='display:none'></div>");
34 EXPECT_EQ(nullptr, document().body()->firstChild()->layoutObject()); 34 EXPECT_EQ(nullptr, document().body()->firstChild()->layoutObject());
35 } 35 }
36 36
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 EXPECT_TRUE(parent->needsPaintOffsetAndVisualRectUpdate()); 265 EXPECT_TRUE(parent->needsPaintOffsetAndVisualRectUpdate());
266 object->clearPaintInvalidationFlags(); 266 object->clearPaintInvalidationFlags();
267 EXPECT_FALSE(object->mayNeedPaintInvalidation()); 267 EXPECT_FALSE(object->mayNeedPaintInvalidation());
268 EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate()); 268 EXPECT_FALSE(object->needsPaintOffsetAndVisualRectUpdate());
269 parent->clearPaintInvalidationFlags(); 269 parent->clearPaintInvalidationFlags();
270 EXPECT_FALSE(parent->mayNeedPaintInvalidation()); 270 EXPECT_FALSE(parent->mayNeedPaintInvalidation());
271 EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate()); 271 EXPECT_FALSE(parent->needsPaintOffsetAndVisualRectUpdate());
272 } 272 }
273 273
274 } // namespace blink 274 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698