Index: Source/web/tests/ScrollingCoordinatorChromiumTest.cpp |
diff --git a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp |
index e3d5677429528de8e4d6504cb05ec066ab94d53c..cdf1a04d84dc8f968b4bf63e8d02589767c9c35f 100644 |
--- a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp |
+++ b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp |
@@ -106,6 +106,11 @@ private: |
FrameTestHelpers::WebViewHelper m_helper; |
}; |
+class GraphicsLayerForScrollTesting : public GraphicsLayer { |
+public: |
+ virtual WebLayer* contentsLayer() const { return GraphicsLayer::contentsLayer(); } |
+}; |
+ |
TEST_F(ScrollingCoordinatorChromiumTest, fastScrollingByDefault) |
{ |
navigateTo("about:blank"); |
@@ -474,4 +479,32 @@ TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldNotCrash) |
// an empty document by javascript. |
} |
+#if OS(MACOSX) |
+TEST_F(ScrollingCoordinatorChromiumTest, DISABLED_setupScrollbarLayerShouldSetScrollLayerOpaque) |
+#else |
+TEST_F(ScrollingCoordinatorChromiumTest, setupScrollbarLayerShouldSetScrollLayerOpaque) |
+#endif |
+{ |
+ registerMockedHttpURLLoad("wide_document.html"); |
+ navigateTo(m_baseURL + "wide_document.html"); |
+ forceFullCompositingUpdate(); |
+ |
+ FrameView* frameView = frame()->view(); |
+ ASSERT_TRUE(frameView); |
+ |
+ GraphicsLayerForScrollTesting* scrollbarGraphicsLayer = static_cast<GraphicsLayerForScrollTesting*>(frameView->layerForHorizontalScrollbar()); |
+ ASSERT_TRUE(scrollbarGraphicsLayer); |
+ |
+ WebLayer* platformLayer = scrollbarGraphicsLayer->platformLayer(); |
+ ASSERT_TRUE(platformLayer); |
+ |
+ WebLayer* contentsLayer = scrollbarGraphicsLayer->contentsLayer(); |
+ ASSERT_TRUE(contentsLayer); |
+ |
+ // After scrollableAreaScrollbarLayerDidChange, |
+ // if the main frame's scrollbarLayer is opaque, |
+ // contentsLayer should be opaque too. |
+ ASSERT_EQ(platformLayer->opaque(), contentsLayer->opaque()); |
+} |
+ |
} // namespace |