diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 10:22:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:36:28 +0000 |
commit | 271a6c3487a14599023a9106329505597638d793 (patch) | |
tree | e040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/third_party/blink/renderer/core/svg/graphics/svg_image_test.cc | |
parent | 7b2ffa587235a47d4094787d72f38102089f402a (diff) | |
download | qtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz |
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/svg/graphics/svg_image_test.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/svg/graphics/svg_image_test.cc | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/chromium/third_party/blink/renderer/core/svg/graphics/svg_image_test.cc b/chromium/third_party/blink/renderer/core/svg/graphics/svg_image_test.cc index f6adc8da886..078ece67a1f 100644 --- a/chromium/third_party/blink/renderer/core/svg/graphics/svg_image_test.cc +++ b/chromium/third_party/blink/renderer/core/svg/graphics/svg_image_test.cc @@ -12,7 +12,7 @@ #include "third_party/blink/renderer/core/frame/local_frame_view.h" #include "third_party/blink/renderer/core/frame/visual_viewport.h" #include "third_party/blink/renderer/core/html/html_image_element.h" -#include "third_party/blink/renderer/core/layout/jank_tracker.h" +#include "third_party/blink/renderer/core/layout/layout_shift_tracker.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include "third_party/blink/renderer/core/paint/paint_layer.h" #include "third_party/blink/renderer/core/svg/graphics/svg_image_chrome_client.h" @@ -114,7 +114,7 @@ TEST_F(SVGImageTest, TimelineSuspendAndResume) { // Fire the timer/trigger a frame update. Since the observer always returns // true for shouldPauseAnimation, this will result in the timeline being // suspended. - test::RunDelayedTasks(TimeDelta::FromMilliseconds(1) + + test::RunDelayedTasks(base::TimeDelta::FromMilliseconds(1) + timer->NextFireInterval()); EXPECT_TRUE(chrome_client.IsSuspended()); EXPECT_FALSE(timer->IsActive()); @@ -148,7 +148,7 @@ TEST_F(SVGImageTest, ResetAnimation) { // Fire the timer/trigger a frame update. The timeline will remain // suspended and no frame will be scheduled. - test::RunDelayedTasks(TimeDelta::FromMillisecondsD(1) + + test::RunDelayedTasks(base::TimeDelta::FromMillisecondsD(1) + timer->NextFireInterval()); EXPECT_TRUE(chrome_client.IsSuspended()); EXPECT_FALSE(timer->IsActive()); @@ -172,14 +172,14 @@ TEST_F(SVGImageTest, SupportsSubsequenceCaching) { ToLayoutBoxModelObject(svg_root)->Layer()->SupportsSubsequenceCaching()); } -TEST_F(SVGImageTest, JankTrackerDisabled) { +TEST_F(SVGImageTest, LayoutShiftTrackerDisabled) { const bool kDontPause = false; Load("<svg xmlns='http://www.w3.org/2000/svg'></svg>", kDontPause); LocalFrame* local_frame = To<LocalFrame>(GetImage().GetPageForTesting()->MainFrame()); EXPECT_TRUE(local_frame->GetDocument()->IsSVGDocument()); - auto& jank_tracker = local_frame->View()->GetJankTracker(); - EXPECT_FALSE(jank_tracker.IsActive()); + auto& layout_shift_tracker = local_frame->View()->GetLayoutShiftTracker(); + EXPECT_FALSE(layout_shift_tracker.IsActive()); } TEST_F(SVGImageTest, SetSizeOnVisualViewport) { @@ -197,6 +197,18 @@ TEST_F(SVGImageTest, SetSizeOnVisualViewport) { GetImage().GetPageForTesting()->GetVisualViewport().Size()); } +TEST_F(SVGImageTest, IsSizeAvailable) { + const bool kShouldPause = false; + Load("<svg xmlns='http://www.w3.org/2000/svg'></svg>", kShouldPause); + EXPECT_TRUE(GetImage().IsSizeAvailable()); + + Load("<notsvg></notsvg>", kShouldPause); + EXPECT_FALSE(GetImage().IsSizeAvailable()); + + Load("<notsvg xmlns='http://www.w3.org/2000/svg'></notsvg>", kShouldPause); + EXPECT_FALSE(GetImage().IsSizeAvailable()); +} + class SVGImageSimTest : public SimTest {}; TEST_F(SVGImageSimTest, PageVisibilityHiddenToVisible) { @@ -226,7 +238,7 @@ TEST_F(SVGImageSimTest, PageVisibilityHiddenToVisible) { // Wait for the next animation frame to be triggered, and then trigger a new // frame. The image animation timeline should be running. - test::RunDelayedTasks(TimeDelta::FromMilliseconds(1) + + test::RunDelayedTasks(base::TimeDelta::FromMilliseconds(1) + timer->NextFireInterval()); Compositor().BeginFrame(); @@ -236,7 +248,7 @@ TEST_F(SVGImageSimTest, PageVisibilityHiddenToVisible) { // fire. This should suspend the image animation. (Suspend the image's // animation timeline.) WebView().SetIsHidden(/*is_hidden=*/true, /*initial_state=*/false); - test::RunDelayedTasks(TimeDelta::FromMilliseconds(1) + + test::RunDelayedTasks(base::TimeDelta::FromMilliseconds(1) + timer->NextFireInterval()); EXPECT_TRUE(svg_image_chrome_client.IsSuspended()); @@ -244,7 +256,7 @@ TEST_F(SVGImageSimTest, PageVisibilityHiddenToVisible) { // Set page visibility to 'visible' - this should schedule a new animation // frame and resume the image animation. WebView().SetIsHidden(/*is_hidden=*/false, /*initial_state=*/false); - test::RunDelayedTasks(TimeDelta::FromMilliseconds(1) + + test::RunDelayedTasks(base::TimeDelta::FromMilliseconds(1) + timer->NextFireInterval()); Compositor().BeginFrame(); |