OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "core/paint/PaintLayer.h" | |
6 | |
7 #include "core/layout/LayoutReplica.h" | |
8 #include "core/layout/LayoutTestHelper.h" | |
9 | |
10 namespace blink { | |
11 | |
12 class PaintLayerTest : public RenderingTest { | |
13 }; | |
14 | |
15 TEST_F(PaintLayerTest, ReflectionLeak) | |
16 { | |
17 setBodyInnerHTML("<div id='div' style='-webkit-box-reflect: above'>test</div
>"); | |
18 HTMLElement* div = toHTMLElement(document().getElementById(AtomicString("div
"))); | |
19 PaintLayerReflectionInfo* reflectionInfo = div->layoutBoxModelObject()->laye
r()->reflectionInfo(); | |
20 ASSERT_TRUE(reflectionInfo); | |
21 LayoutReplica* replica = reflectionInfo->reflection(); | |
22 ASSERT_TRUE(replica); | |
23 | |
24 div->setAttribute(HTMLNames::styleAttr, "-webkit-box-reflect: below"); | |
25 document().view()->updateAllLifecyclePhases(); | |
26 | |
27 PaintLayerReflectionInfo* newReflectionInfo = div->layoutBoxModelObject()->l
ayer()->reflectionInfo(); | |
28 ASSERT_TRUE(newReflectionInfo); | |
29 EXPECT_NE(reflectionInfo, newReflectionInfo); | |
30 LayoutReplica* newReplica = newReflectionInfo->reflection(); | |
31 ASSERT_TRUE(newReplica); | |
32 EXPECT_NE(replica, newReplica); | |
33 | |
34 // LeakDetector should report no leaks of LayoutReplica or PaintLayer. | |
35 } | |
36 | |
37 } // namespace blink | |
OLD | NEW |