Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp

Issue 2345403003: Add background attachment fixed main thread scrolling reason [spv2] (Closed)
Patch Set: Minor cleanup Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
index 079db6539672fe75b9fc1f035690307dec90b527..30a37499fad58b6eae9144b32bcf158a7434fe1a 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -569,6 +569,8 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, OneScrollNode)
EXPECT_TRUE(transformNode.local.IsIdentity());
EXPECT_EQ(gfx::ScrollOffset(-7, -9), scrollTree.current_scroll_offset(contentLayerAt(0)->id()));
+
+ EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain, scrollNode.main_thread_scrolling_reasons);
}
TEST_F(PaintArtifactCompositorTestWithPropertyTrees, NestedScrollNodes)
@@ -583,6 +585,7 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, NestedScrollNodes)
scrollTranslationA, TransformationMatrix().translate(37, 41), FloatPoint3D());
RefPtr<ScrollPaintPropertyNode> scrollB = ScrollPaintPropertyNode::create(
scrollA, scrollTranslationB, IntSize(19, 23), IntSize(29, 31), true, false);
+ scrollB->setBackgroundAttachmentFixedMainThreadScrollingReason();
TestPaintArtifact artifact;
artifact.chunk(scrollTranslationA, nullptr, effect, scrollA)
@@ -615,6 +618,10 @@ TEST_F(PaintArtifactCompositorTestWithPropertyTrees, NestedScrollNodes)
EXPECT_EQ(gfx::ScrollOffset(-11, -13), scrollTree.current_scroll_offset(contentLayerAt(0)->id()));
EXPECT_EQ(gfx::ScrollOffset(-37, -41), scrollTree.current_scroll_offset(contentLayerAt(1)->id()));
+
+ // The main thread scrolling bits from scrollNodeB should have been propagated to scrollNodeA.
+ EXPECT_TRUE(scrollNodeA.main_thread_scrolling_reasons & MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
+ EXPECT_TRUE(scrollNodeB.main_thread_scrolling_reasons & MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698