Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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/compositing/CompositingReasonFinder.h" | 5 #include "core/layout/compositing/CompositingReasonFinder.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutBlock.h" | 8 #include "core/layout/LayoutBlock.h" |
| 9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
| 10 #include "core/paint/PaintLayer.h" | 10 #include "core/paint/PaintLayer.h" |
| 11 #include "platform/graphics/GraphicsLayer.h" | 11 #include "platform/graphics/GraphicsLayer.h" |
| 12 #include "platform/scroll/ScrollTypes.h" | 12 #include "platform/scroll/ScrollTypes.h" |
| 13 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" | 13 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class CompositingReasonFinderTest : public RenderingTest { | 17 class CompositingReasonFinderTest : public RenderingTest { |
| 18 public: | 18 public: |
| 19 CompositingReasonFinderTest() | 19 CompositingReasonFinderTest() |
| 20 : RenderingTest(SingleChildFrameLoaderClient::create()) {} | 20 : RenderingTest(EmptyFrameLoaderClient::create()) {} |
|
dcheng
2016/11/17 08:49:58
These tests don't actually need iframes, so just d
| |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 void SetUp() override { | 23 void SetUp() override { |
| 24 RenderingTest::SetUp(); | 24 RenderingTest::SetUp(); |
| 25 enableCompositing(); | 25 enableCompositing(); |
| 26 } | 26 } |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 TEST_F(CompositingReasonFinderTest, PromoteOpaqueFixedPosition) { | 29 TEST_F(CompositingReasonFinderTest, PromoteOpaqueFixedPosition) { |
| 30 ScopedCompositeFixedPositionForTest compositeFixedPosition(true); | 30 ScopedCompositeFixedPositionForTest compositeFixedPosition(true); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 EXPECT_TRUE(paintLayer->graphicsLayerBacking()->contentsOpaque()); | 153 EXPECT_TRUE(paintLayer->graphicsLayerBacking()->contentsOpaque()); |
| 154 | 154 |
| 155 // Make the fixed translucent. | 155 // Make the fixed translucent. |
| 156 fixed->setAttribute(HTMLNames::styleAttr, "opacity: 0.5"); | 156 fixed->setAttribute(HTMLNames::styleAttr, "opacity: 0.5"); |
| 157 document().view()->updateAllLifecyclePhases(); | 157 document().view()->updateAllLifecyclePhases(); |
| 158 paintLayer = toLayoutBoxModelObject(fixed->layoutObject())->layer(); | 158 paintLayer = toLayoutBoxModelObject(fixed->layoutObject())->layer(); |
| 159 ASSERT_TRUE(paintLayer); | 159 ASSERT_TRUE(paintLayer); |
| 160 EXPECT_EQ(NotComposited, paintLayer->compositingState()); | 160 EXPECT_EQ(NotComposited, paintLayer->compositingState()); |
| 161 } | 161 } |
| 162 } | 162 } |
| OLD | NEW |