Commit 7a20ff05 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Fix compositor_unittests failures in UBSanVptr Linux builder

It turns out layer_tree_host_ can be nullptr in tests which
passes unexpectedly on bots other than UBSan bots. This CL
fixes this behavior.

Bug: 989936
Test: compositor_unittests on the UBsan gn flags
Change-Id: I6e8ff606709b07f19e6309e3b5a96ca240f0de99
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1731954Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Commit-Queue: Jun Mukai <mukai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683419}
parent c646f806
...@@ -664,9 +664,10 @@ void Layer::SetRoundedCorner(const gfx::RoundedCornersF& corner_radii) { ...@@ -664,9 +664,10 @@ void Layer::SetRoundedCorner(const gfx::RoundedCornersF& corner_radii) {
inputs_.corner_radii = corner_radii; inputs_.corner_radii = corner_radii;
SetSubtreePropertyChanged(); SetSubtreePropertyChanged();
SetNeedsCommit(); SetNeedsCommit();
PropertyTrees* property_trees = layer_tree_host_->property_trees(); PropertyTrees* property_trees =
layer_tree_host_ ? layer_tree_host_->property_trees() : nullptr;
EffectNode* node = nullptr; EffectNode* node = nullptr;
if (effect_tree_index() != EffectTree::kInvalidNodeId && if (property_trees && effect_tree_index() != EffectTree::kInvalidNodeId &&
(node = property_trees->effect_tree.Node(effect_tree_index()))) { (node = property_trees->effect_tree.Node(effect_tree_index()))) {
node->rounded_corner_bounds = node->rounded_corner_bounds =
gfx::RRectF(EffectiveClipRect(), corner_radii); gfx::RRectF(EffectiveClipRect(), corner_radii);
......
...@@ -774,13 +774,7 @@ TEST_P(LayerWithRealCompositorTest, HierarchyNoTexture) { ...@@ -774,13 +774,7 @@ TEST_P(LayerWithRealCompositorTest, HierarchyNoTexture) {
EXPECT_TRUE(d3.painted()); EXPECT_TRUE(d3.painted());
} }
// crbug.com/989936 TEST_F(LayerWithDelegateTest, Cloning) {
#if defined(OS_LINUX) && defined(UNDEFINED_SANITIZER)
#define MAYBE_Cloning DISABLED_Cloning
#else
#define MAYBE_Cloning Cloning
#endif
TEST_F(LayerWithDelegateTest, MAYBE_Cloning) {
std::unique_ptr<Layer> layer = CreateLayer(LAYER_SOLID_COLOR); std::unique_ptr<Layer> layer = CreateLayer(LAYER_SOLID_COLOR);
gfx::Transform transform; gfx::Transform transform;
...@@ -1045,14 +1039,8 @@ TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) { ...@@ -1045,14 +1039,8 @@ TEST_F(LayerWithNullDelegateTest, EscapedDebugNames) {
ASSERT_TRUE(roundtrip); ASSERT_TRUE(roundtrip);
EXPECT_EQ(name, *roundtrip); EXPECT_EQ(name, *roundtrip);
} }
// crbug.com/989936
#if defined(OS_LINUX) && defined(UNDEFINED_SANITIZER) TEST_F(LayerWithNullDelegateTest, SwitchLayerPreservesCCLayerState) {
#define MAYBE_SwitchLayerPreservesCCLayerState \
DISABLED_SwitchLayerPreservesCCLayerState
#else
#define MAYBE_SwitchLayerPreservesCCLayerState SwitchLayerPreservesCCLayerState
#endif
TEST_F(LayerWithNullDelegateTest, MAYBE_SwitchLayerPreservesCCLayerState) {
std::unique_ptr<Layer> l1 = CreateLayer(LAYER_SOLID_COLOR); std::unique_ptr<Layer> l1 = CreateLayer(LAYER_SOLID_COLOR);
l1->SetFillsBoundsOpaquely(true); l1->SetFillsBoundsOpaquely(true);
l1->SetVisible(false); l1->SetVisible(false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment