| OLD | NEW |
| 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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 CreateCompositorElementId(DOMNodeIds::IdForNode(element_composited), |
| 801 CompositorSubElementId::kPrimary); | 801 CompositorSubElementId::kPrimary); |
| 802 composited_element_ids->insert(expected_compositor_element_id); | 802 composited_element_ids->insert(expected_compositor_element_id.id); |
| 803 | 803 |
| 804 Timing timing; | 804 Timing timing; |
| 805 timing.iteration_duration = 30; | 805 timing.iteration_duration = 30; |
| 806 timing.playback_rate = 1; | 806 timing.playback_rate = 1; |
| 807 KeyframeEffect* keyframe_effect_composited = | 807 KeyframeEffect* keyframe_effect_composited = |
| 808 KeyframeEffect::Create(element_composited.Get(), nullptr, timing); | 808 KeyframeEffect::Create(element_composited.Get(), nullptr, timing); |
| 809 Animation* animation_composited = timeline->Play(keyframe_effect_composited); | 809 Animation* animation_composited = timeline->Play(keyframe_effect_composited); |
| 810 KeyframeEffect* keyframe_effect_not_composited = | 810 KeyframeEffect* keyframe_effect_not_composited = |
| 811 KeyframeEffect::Create(element_not_composited.Get(), nullptr, timing); | 811 KeyframeEffect::Create(element_not_composited.Get(), nullptr, timing); |
| 812 Animation* animation_not_composited = | 812 Animation* animation_not_composited = |
| 813 timeline->Play(keyframe_effect_not_composited); | 813 timeline->Play(keyframe_effect_not_composited); |
| 814 | 814 |
| 815 SimulateFrame(0, composited_element_ids); | 815 SimulateFrame(0, composited_element_ids); |
| 816 EXPECT_TRUE(animation_composited->CanStartAnimationOnCompositor( | 816 EXPECT_TRUE(animation_composited->CanStartAnimationOnCompositor( |
| 817 composited_element_ids)); | 817 composited_element_ids)); |
| 818 EXPECT_FALSE(animation_not_composited->CanStartAnimationOnCompositor( | 818 EXPECT_FALSE(animation_not_composited->CanStartAnimationOnCompositor( |
| 819 composited_element_ids)); | 819 composited_element_ids)); |
| 820 } | 820 } |
| 821 | 821 |
| 822 } // namespace blink | 822 } // namespace blink |
| OLD | NEW |