| Index: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
|
| index 73fdb7a20d2691f44a11151b6d97d4362385b084..bd43097df3fc0e8e89cc0d82b62c662ed95af637 100644
|
| --- a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
|
| @@ -439,4 +439,30 @@ TEST_F(FrameThrottlingTest, ScrollingCoordinatorShouldSkipThrottledFrame)
|
| EXPECT_TRUE(document().view()->shouldScrollOnMainThread());
|
| }
|
|
|
| +TEST_F(FrameThrottlingTest, UnthrottleByTransformingWithoutLayout)
|
| +{
|
| + webView().settings()->setAcceleratedCompositingEnabled(true);
|
| +
|
| + // Create a hidden frame which is throttled.
|
| + SimRequest mainResource("https://example.com/", "text/html");
|
| + SimRequest frameResource("https://example.com/iframe.html", "text/html");
|
| +
|
| + loadURL("https://example.com/");
|
| + mainResource.complete("<iframe id=frame sandbox src=iframe.html></iframe>");
|
| + frameResource.complete("");
|
| +
|
| + // Move the frame offscreen to throttle it.
|
| + auto* frameElement = toHTMLIFrameElement(document().getElementById("frame"));
|
| + frameElement->setAttribute(styleAttr, "transform: translateY(480px)");
|
| + EXPECT_FALSE(frameElement->contentDocument()->view()->canThrottleRendering());
|
| + compositeFrame();
|
| + EXPECT_TRUE(frameElement->contentDocument()->view()->canThrottleRendering());
|
| +
|
| + // Make the frame visible by changing its transform. This doesn't cause a
|
| + // layout, but should still unthrottle the frame.
|
| + frameElement->setAttribute(styleAttr, "transform: translateY(0px)");
|
| + compositeFrame();
|
| + EXPECT_FALSE(frameElement->contentDocument()->view()->canThrottleRendering());
|
| +}
|
| +
|
| } // namespace blink
|
|
|