Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
index b32fcc1acb9da6242273a65169a6841ba8c3610c..be77ae5a4d12b6ab0da33ffa6834cf06abbde6d3 100644 |
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp |
@@ -8170,8 +8170,8 @@ namespace { |
class TestFullscreenWebLayerTreeView : public WebLayerTreeView { |
public: |
- void setHasTransparentBackground(bool value) override { |
- hasTransparentBackground = value; |
+ void setBackgroundColor(blink::WebColor color) override { |
+ hasTransparentBackground = SkColorGetA(color) < SK_AlphaOPAQUE; |
} |
bool hasTransparentBackground = false; |
}; |
@@ -11505,4 +11505,23 @@ TEST_F(WebFrameTest, ContextMenuData) { |
EXPECT_TRUE(testSelectAll("<div contenteditable>nonempty</div>")); |
} |
+TEST_F(WebFrameTest, LocalFrameWithRemoteParentIsTransparent) { |
+ FrameTestHelpers::TestWebViewClient viewClient; |
+ FrameTestHelpers::TestWebRemoteFrameClient remoteClient; |
+ WebView* view = WebView::create(&viewClient, WebPageVisibilityStateVisible); |
+ view->settings()->setJavaScriptEnabled(true); |
+ view->setMainFrame(remoteClient.frame()); |
+ WebRemoteFrame* root = view->mainFrame()->toWebRemoteFrame(); |
+ root->setReplicatedOrigin(SecurityOrigin::createUnique()); |
+ |
+ WebLocalFrameImpl* localFrame = FrameTestHelpers::createLocalChild(root); |
+ FrameTestHelpers::loadFrame(localFrame, "data:text/html,some page"); |
+ |
+ // Local frame with remote parent should have transparent baseBackgroundColor. |
+ Color color = localFrame->frameView()->baseBackgroundColor(); |
+ EXPECT_EQ(Color::transparent, color); |
+ |
+ view->close(); |
+} |
+ |
} // namespace blink |