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

Unified Diff: third_party/WebKit/Source/core/animation/AnimationTest.cpp

Issue 2890953002: [SPv1] Always set a CompositorElementId on main graphics layers; use PaintLayer id. (Closed)
Patch Set: none 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/animation/AnimationTest.cpp
diff --git a/third_party/WebKit/Source/core/animation/AnimationTest.cpp b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
index 0dd77fd51e351334ebb08ff741767e761c0be3a5..14fc316c98581e534093c671bdff43aa143b708e 100644
--- a/third_party/WebKit/Source/core/animation/AnimationTest.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
@@ -39,6 +39,8 @@
#include "core/dom/DOMNodeIds.h"
#include "core/dom/Document.h"
#include "core/dom/QualifiedName.h"
+#include "core/layout/LayoutTestHelper.h"
+#include "core/paint/PaintLayer.h"
#include "core/testing/DummyPageHolder.h"
#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "platform/weborigin/KURL.h"
@@ -46,9 +48,13 @@
namespace blink {
-class AnimationAnimationTest : public ::testing::Test {
- protected:
+class AnimationAnimationTest : public RenderingTest {
+ public:
+ AnimationAnimationTest()
+ : RenderingTest(SingleChildLocalFrameClient::Create()) {}
+
void SetUp() override {
+ RenderingTest::SetUp();
SetUpWithoutStartingTimeline();
StartTimeline();
}
@@ -791,25 +797,29 @@ TEST_F(AnimationAnimationTest, PauseAfterCancel) {
TEST_F(AnimationAnimationTest, NoCompositeWithoutCompositedElementId) {
ScopedSlimmingPaintV2ForTest enable_s_pv2(true);
- Persistent<Element> element_composited = document->createElement("foo");
- Persistent<Element> element_not_composited = document->createElement("bar");
+ SetBodyInnerHTML(
+ "<div id='foo' style='position: relative'></div>"
+ "<div id='bar' style='position: relative'></div>");
+
+ LayoutObject* object_composited = GetLayoutObjectByElementId("foo");
+ LayoutObject* object_not_composited = GetLayoutObjectByElementId("bar");
Optional<CompositorElementIdSet> composited_element_ids =
CompositorElementIdSet();
CompositorElementId expected_compositor_element_id =
- CompositorElementIdFromDOMNodeId(
- DOMNodeIds::IdForNode(element_composited),
+ CompositorElementIdFromPaintLayerId(
+ ToLayoutBoxModelObject(object_composited)->Layer()->UniqueId(),
CompositorElementIdNamespace::kPrimary);
composited_element_ids->insert(expected_compositor_element_id);
Timing timing;
timing.iteration_duration = 30;
timing.playback_rate = 1;
- KeyframeEffect* keyframe_effect_composited =
- KeyframeEffect::Create(element_composited.Get(), nullptr, timing);
+ KeyframeEffect* keyframe_effect_composited = KeyframeEffect::Create(
+ ToElement(object_composited->GetNode()), nullptr, timing);
Animation* animation_composited = timeline->Play(keyframe_effect_composited);
- KeyframeEffect* keyframe_effect_not_composited =
- KeyframeEffect::Create(element_not_composited.Get(), nullptr, timing);
+ KeyframeEffect* keyframe_effect_not_composited = KeyframeEffect::Create(
+ ToElement(object_not_composited->GetNode()), nullptr, timing);
Animation* animation_not_composited =
timeline->Play(keyframe_effect_not_composited);

Powered by Google App Engine
This is Rietveld 408576698