diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/third_party/blink/renderer/core/scheduler_integration_tests | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-c30a6232df03e1efbd9f3b226777b07e087a1122.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/scheduler_integration_tests')
-rw-r--r-- | chromium/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/chromium/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc b/chromium/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc index b137d33dc27..658ec6cf8b4 100644 --- a/chromium/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc +++ b/chromium/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc @@ -12,7 +12,6 @@ #include "third_party/blink/renderer/bindings/core/v8/script_source_code.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/element.h" -#include "third_party/blink/renderer/core/exported/web_remote_frame_impl.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" @@ -1513,4 +1512,68 @@ TEST_P(FrameThrottlingTest, GraphicsLayerCollection) { EXPECT_EQ(display_item_count, paint_controller->GetDisplayItemList().size()); } +TEST_P(FrameThrottlingTest, NestedFramesInRemoteFrameHiddenAndShown) { + InitializeRemote(); + + SimRequest local_root_resource("https://example.com/", "text/html"); + SimRequest frame_resource("https://example.com/iframe.html", "text/html"); + SimRequest child_frame_resource("https://example.com/child-iframe.html", + "text/html"); + + LoadURL("https://example.com/"); + local_root_resource.Complete( + "<iframe id=frame sandbox src=iframe.html></iframe>"); + frame_resource.Complete( + "<iframe id=child-frame sandbox src=child-iframe.html></iframe>"); + child_frame_resource.Complete(""); + + ViewportIntersectionState intersection; + intersection.main_frame_document_intersection = WebRect(0, 0, 100, 100); + intersection.main_frame_viewport_size = WebSize(100, 100); + intersection.viewport_intersection = WebRect(0, 0, 100, 100); + LocalFrameRoot().FrameWidget()->Resize(WebSize(300, 200)); + LocalFrameRoot().FrameWidget()->SetRemoteViewportIntersection(intersection); + + auto* root_document = LocalFrameRoot().GetFrame()->GetDocument(); + auto* frame_document = + To<HTMLIFrameElement>(root_document->getElementById("frame")) + ->contentDocument(); + auto* frame_view = frame_document->View(); + auto* child_document = + To<HTMLIFrameElement>(frame_document->getElementById("child-frame")) + ->contentDocument(); + auto* child_view = child_document->View(); + + CompositeFrame(); + EXPECT_FALSE(frame_view->CanThrottleRendering()); + EXPECT_FALSE(child_view->CanThrottleRendering()); + + // Hide the frame without any other change. + LocalFrameRoot().WasHidden(); + EXPECT_TRUE(frame_view->CanThrottleRendering()); + EXPECT_TRUE(child_view->CanThrottleRendering()); + EXPECT_FALSE(Compositor().NeedsBeginFrame()); + + // Simulate a trivial style change that doesn't trigger layout, compositing + // update, but schedules layout tree update. + frame_document->documentElement()->setAttribute(html_names::kStyleAttr, + "color: blue"); + // This is needed to reproduce crbug.com/1054644 before the fix. + frame_view->SetNeedsPaintPropertyUpdate(); + + // Show the frame without any other change. + LocalFrameRoot().WasShown(); + LocalFrameRoot().FrameWidget()->SetRemoteViewportIntersection(intersection); + CompositeFrame(); + EXPECT_FALSE(frame_view->CanThrottleRendering()); + // The child frame's throtting status is not updated because the parent + // document has pending visual update. + EXPECT_TRUE(child_view->CanThrottleRendering()); + + CompositeFrame(); + EXPECT_FALSE(frame_view->CanThrottleRendering()); + // The child frame's throttling status should be updated now. + EXPECT_FALSE(child_view->CanThrottleRendering()); +} + } // namespace blink |