Index: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp |
index 13e261855593600ea9c9e7db09557034cb7d4550..d3db5105cf0fca43ac258f758783a70e5416f066 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp |
@@ -32,23 +32,14 @@ class PaintLayerPainterTest |
: ScopedRootLayerScrollingForTest(GetParam().root_layer_scrolling), |
PaintControllerPaintTestBase(GetParam().slimming_paint_v2) {} |
- void ExpectPaintedOutputVisibility(const char* element_name, |
- bool expected_spv1) { |
- ExpectPaintedOutputVisibility(element_name, expected_spv1, expected_spv1); |
wkorman
2017/04/20 22:23:56
With this patch we've seemingly achieved conformit
|
- } |
- |
- void ExpectPaintedOutputVisibility(const char* element_name, |
wkorman
2017/04/20 22:23:56
I renamed this for easier mental parsing w.r.t. it
|
- bool expected_spv1, |
- bool expected_spv2) { |
+ void ExpectPaintedOutputInvisible(const char* element_name, |
+ bool expected_value) { |
PaintLayer* target_layer = |
ToLayoutBox(GetLayoutObjectByElementId(element_name))->Layer(); |
PaintLayerPaintingInfo painting_info(nullptr, LayoutRect(), |
kGlobalPaintNormalPhase, LayoutSize()); |
bool invisible = |
PaintLayerPainter(*target_layer).PaintedOutputInvisible(painting_info); |
- bool expected_value = RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
- ? expected_spv2 |
- : expected_spv1; |
EXPECT_EQ(expected_value, invisible) |
<< "Failed painted output visibility [spv2_enabled=" |
<< RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
@@ -795,21 +786,21 @@ TEST_P(PaintLayerPainterTest, |
TEST_P(PaintLayerPainterTest, DontPaintWithTinyOpacity) { |
SetBodyInnerHTML( |
"<div id='target' style='background: blue; opacity: 0.0001'></div>"); |
- ExpectPaintedOutputVisibility("target", true, false); |
wkorman
2017/04/20 22:23:56
Highlighting -- this is one of two test cases stan
|
+ ExpectPaintedOutputInvisible("target", true); |
} |
TEST_P(PaintLayerPainterTest, DoPaintWithTinyOpacityAndWillChangeOpacity) { |
SetBodyInnerHTML( |
"<div id='target' style='background: blue; opacity: 0.0001; " |
"will-change: opacity'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, DoPaintWithTinyOpacityAndBackdropFilter) { |
SetBodyInnerHTML( |
"<div id='target' style='background: blue; opacity: 0.0001;" |
" backdrop-filter: blur(2px);'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, |
@@ -817,20 +808,20 @@ TEST_P(PaintLayerPainterTest, |
SetBodyInnerHTML( |
"<div id='target' style='background: blue; opacity: 0.0001;" |
" backdrop-filter: blur(2px); will-change: opacity'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, DoPaintWithCompositedTinyOpacity) { |
SetBodyInnerHTML( |
"<div id='target' style='background: blue; opacity: 0.0001;" |
" will-change: transform'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, DoPaintWithNonTinyOpacity) { |
SetBodyInnerHTML( |
"<div id='target' style='background: blue; opacity: 0.1'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, DoPaintWithEffectAnimationZeroOpacity) { |
@@ -848,7 +839,7 @@ TEST_P(PaintLayerPainterTest, DoPaintWithEffectAnimationZeroOpacity) { |
"} " |
"</style> " |
"<div id='target'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, DontPaintWithTransformAnimationZeroOpacity) { |
@@ -865,7 +856,7 @@ TEST_P(PaintLayerPainterTest, DontPaintWithTransformAnimationZeroOpacity) { |
"} " |
"</style> " |
"<div id='target'>x</div></div>"); |
- ExpectPaintedOutputVisibility("target", false, true); |
+ ExpectPaintedOutputInvisible("target", false); |
wkorman
2017/04/20 22:23:56
Highlighting -- this is one of two test cases stan
|
} |
TEST_P(PaintLayerPainterTest, |
@@ -884,7 +875,7 @@ TEST_P(PaintLayerPainterTest, |
"} " |
"</style> " |
"<div id='target'>x</div></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, DoPaintWithWillChangeOpacity) { |
@@ -897,7 +888,7 @@ TEST_P(PaintLayerPainterTest, DoPaintWithWillChangeOpacity) { |
"}" |
"</style> " |
"<div id='target'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, DoPaintWithZeroOpacityAndWillChangeOpacity) { |
@@ -911,7 +902,7 @@ TEST_P(PaintLayerPainterTest, DoPaintWithZeroOpacityAndWillChangeOpacity) { |
"}" |
"</style> " |
"<div id='target'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
TEST_P(PaintLayerPainterTest, |
@@ -926,7 +917,7 @@ TEST_P(PaintLayerPainterTest, |
"}" |
"</style> " |
"<div id='target'></div>"); |
- ExpectPaintedOutputVisibility("target", false); |
+ ExpectPaintedOutputInvisible("target", false); |
} |
} // namespace blink |