Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp

Issue 2889783003: Only allow subsequence caching for SVG documents, not inline SVG. (Closed)
Patch Set: Merge branch 'master' into fixsvg Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/svg/graphics/SVGImage.h" 5 #include "core/svg/graphics/SVGImage.h"
6 6
7 #include "core/frame/FrameView.h"
8 #include "core/layout/LayoutView.h"
9 #include "core/paint/PaintLayer.h"
7 #include "core/svg/graphics/SVGImageChromeClient.h" 10 #include "core/svg/graphics/SVGImageChromeClient.h"
8 #include "platform/SharedBuffer.h" 11 #include "platform/SharedBuffer.h"
9 #include "platform/Timer.h" 12 #include "platform/Timer.h"
10 #include "platform/geometry/FloatRect.h" 13 #include "platform/geometry/FloatRect.h"
11 #include "platform/graphics/paint/PaintCanvas.h" 14 #include "platform/graphics/paint/PaintCanvas.h"
12 #include "platform/graphics/paint/PaintFlags.h" 15 #include "platform/graphics/paint/PaintFlags.h"
13 #include "platform/testing/UnitTestHelpers.h" 16 #include "platform/testing/UnitTestHelpers.h"
14 #include "platform/wtf/PtrUtil.h" 17 #include "platform/wtf/PtrUtil.h"
15 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
16 #include "third_party/skia/include/core/SkCanvas.h" 19 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 testing::RunDelayedTasks(1.0 + timer->NextFireInterval() * 1000.0); 141 testing::RunDelayedTasks(1.0 + timer->NextFireInterval() * 1000.0);
139 EXPECT_TRUE(chrome_client.IsSuspended()); 142 EXPECT_TRUE(chrome_client.IsSuspended());
140 EXPECT_FALSE(timer->IsActive()); 143 EXPECT_FALSE(timer->IsActive());
141 144
142 // Simulate a draw. This should resume the animation again. 145 // Simulate a draw. This should resume the animation again.
143 PumpFrame(); 146 PumpFrame();
144 EXPECT_FALSE(chrome_client.IsSuspended()); 147 EXPECT_FALSE(chrome_client.IsSuspended());
145 EXPECT_TRUE(timer->IsActive()); 148 EXPECT_TRUE(timer->IsActive());
146 } 149 }
147 150
151 TEST_F(SVGImageTest, SupportsSubsequenceCaching) {
152 const bool kShouldPause = true;
153 Load(kAnimatedDocument, kShouldPause);
154 PumpFrame();
155 LocalFrame* local_frame =
156 ToLocalFrame(GetImage().GetPageForTesting()->MainFrame());
157 EXPECT_TRUE(local_frame->GetDocument()->IsSVGDocument());
158 LayoutObject* svg_root = local_frame->View()->GetLayoutView()->FirstChild();
159 EXPECT_TRUE(svg_root->IsSVGRoot());
160 EXPECT_TRUE(
161 ToLayoutBoxModelObject(svg_root)->Layer()->SupportsSubsequenceCaching());
162 }
163
148 } // namespace blink 164 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698