OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
chrishtr
2016/08/04 16:35:44
2016
Stephen Chennney
2016/08/04 17:35:25
Done.
chrishtr
2016/08/09 18:03:40
Still not done. Update the patchset?
| |
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/PaintLayerScrollableAreaTest.h" | |
6 | |
7 namespace blink { | |
8 | |
9 TEST_F(PaintLayerScrollableAreaTest, OpaqueLayersPromoted) | |
10 { | |
11 RuntimeEnabledFeatures::setCompositeOpaqueScrollersEnabled(true); | |
12 | |
13 setBodyInnerHTML( | |
14 "<style>" | |
15 "#scroller { overflow: scroll; height: 300px; width: 300px; background-c olor: rgb(0,128,0); }" | |
16 "#scrolled { height: 1000px; width: 250px; }" | |
17 "</style>" | |
18 "<div id=\"scroller\"><div id=\"scrolled\"></div></div>"); | |
19 document().view()->updateAllLifecyclePhases(); | |
20 | |
21 ASSERT_TRUE(RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled()); | |
22 Element* scroller = document().getElementById("scroller"); | |
23 PaintLayer* paintLayer = toLayoutBoxModelObject(scroller->layoutObject())->l ayer(); | |
24 ASSERT_TRUE(paintLayer); | |
25 DisableCompositingQueryAsserts compositingQueryEnabler; | |
chrishtr
2016/08/04 16:35:44
Why do you need this? The lifecycle should be up t
Stephen Chennney
2016/08/04 17:35:25
Artifact of an earlier iteration of the test. Gone
| |
26 ASSERT_TRUE(paintLayer->needsCompositedScrolling()); | |
27 } | |
28 | |
29 TEST_F(PaintLayerScrollableAreaTest, TransparentLayersNotPromoted) | |
30 { | |
31 RuntimeEnabledFeatures::setCompositeOpaqueScrollersEnabled(true); | |
32 | |
33 setBodyInnerHTML( | |
34 "<style>" | |
35 "#scroller { overflow: scroll; height: 300px; width: 300px; background-c olor: rgba(0,128,0,0.5); }" | |
36 "#scrolled { height: 1000px; width: 250px; }" | |
37 "</style>" | |
38 "<div id=\"scroller\"><div id=\"scrolled\"></div></div>"); | |
39 document().view()->updateAllLifecyclePhases(); | |
40 | |
41 ASSERT_TRUE(RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled()); | |
42 Element* scroller = document().getElementById("scroller"); | |
43 PaintLayer* paintLayer = toLayoutBoxModelObject(scroller->layoutObject())->l ayer(); | |
44 ASSERT_TRUE(paintLayer); | |
45 DisableCompositingQueryAsserts compositingQueryEnabler; | |
46 ASSERT_TRUE(!paintLayer->needsCompositedScrolling()); | |
47 } | |
48 | |
49 } | |
OLD | NEW |