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

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationTest.cpp

Issue 2877033002: Fix cc scrollbar layer issues with initialization, and use element ids throughout. (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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 790
791 TEST_F(AnimationAnimationTest, NoCompositeWithoutCompositedElementId) { 791 TEST_F(AnimationAnimationTest, NoCompositeWithoutCompositedElementId) {
792 ScopedSlimmingPaintV2ForTest enable_s_pv2(true); 792 ScopedSlimmingPaintV2ForTest enable_s_pv2(true);
793 793
794 Persistent<Element> element_composited = document->createElement("foo"); 794 Persistent<Element> element_composited = document->createElement("foo");
795 Persistent<Element> element_not_composited = document->createElement("bar"); 795 Persistent<Element> element_not_composited = document->createElement("bar");
796 796
797 Optional<CompositorElementIdSet> composited_element_ids = 797 Optional<CompositorElementIdSet> composited_element_ids =
798 CompositorElementIdSet(); 798 CompositorElementIdSet();
799 CompositorElementId expected_compositor_element_id = 799 CompositorElementId expected_compositor_element_id =
800 CreateCompositorElementId(DOMNodeIds::IdForNode(element_composited), 800 CompositorElementIdFromDOMNodeId(
801 CompositorSubElementId::kPrimary); 801 DOMNodeIds::IdForNode(element_composited),
802 CompositorElementIdNamespace::kPrimary);
802 composited_element_ids->insert(expected_compositor_element_id); 803 composited_element_ids->insert(expected_compositor_element_id);
803 804
804 Timing timing; 805 Timing timing;
805 timing.iteration_duration = 30; 806 timing.iteration_duration = 30;
806 timing.playback_rate = 1; 807 timing.playback_rate = 1;
807 KeyframeEffect* keyframe_effect_composited = 808 KeyframeEffect* keyframe_effect_composited =
808 KeyframeEffect::Create(element_composited.Get(), nullptr, timing); 809 KeyframeEffect::Create(element_composited.Get(), nullptr, timing);
809 Animation* animation_composited = timeline->Play(keyframe_effect_composited); 810 Animation* animation_composited = timeline->Play(keyframe_effect_composited);
810 KeyframeEffect* keyframe_effect_not_composited = 811 KeyframeEffect* keyframe_effect_not_composited =
811 KeyframeEffect::Create(element_not_composited.Get(), nullptr, timing); 812 KeyframeEffect::Create(element_not_composited.Get(), nullptr, timing);
812 Animation* animation_not_composited = 813 Animation* animation_not_composited =
813 timeline->Play(keyframe_effect_not_composited); 814 timeline->Play(keyframe_effect_not_composited);
814 815
815 SimulateFrame(0, composited_element_ids); 816 SimulateFrame(0, composited_element_ids);
816 EXPECT_TRUE(animation_composited->CanStartAnimationOnCompositor( 817 EXPECT_TRUE(animation_composited->CanStartAnimationOnCompositor(
817 composited_element_ids)); 818 composited_element_ids));
818 EXPECT_FALSE(animation_not_composited->CanStartAnimationOnCompositor( 819 EXPECT_FALSE(animation_not_composited->CanStartAnimationOnCompositor(
819 composited_element_ids)); 820 composited_element_ids));
820 } 821 }
821 822
822 } // namespace blink 823 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698