OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 OwnPtr<WebLayerTreeView> m_layerTreeView; | 93 OwnPtr<WebLayerTreeView> m_layerTreeView; |
94 MockGraphicsLayerClient m_client; | 94 MockGraphicsLayerClient m_client; |
95 }; | 95 }; |
96 | 96 |
97 TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) | 97 TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) |
98 { | 98 { |
99 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); | 99 ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); |
100 | 100 |
101 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->composi
torSupport()->createFloatAnimationCurve()); | 101 OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(Platform::current()->composi
torSupport()->createFloatAnimationCurve()); |
102 curve->add(WebFloatKeyframe(0.0, 0.0)); | 102 curve->add(WebFloatKeyframe(0.0, 0.0)); |
103 OwnPtr<WebAnimation> floatAnimation(adoptPtr(Platform::current()->compositor
Support()->createAnimation(*curve, WebAnimation::TargetPropertyOpacity))); | 103 OwnPtr<WebCompositorAnimation> floatAnimation(adoptPtr(Platform::current()->
compositorSupport()->createAnimation(*curve, WebCompositorAnimation::TargetPrope
rtyOpacity))); |
104 int animationId = floatAnimation->id(); | 104 int animationId = floatAnimation->id(); |
105 ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.leakPtr())); | 105 ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation.leakPtr())); |
106 | 106 |
107 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); | 107 ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); |
108 | 108 |
109 m_graphicsLayer->setShouldFlattenTransform(false); | 109 m_graphicsLayer->setShouldFlattenTransform(false); |
110 | 110 |
111 m_platformLayer = m_graphicsLayer->platformLayer(); | 111 m_platformLayer = m_graphicsLayer->platformLayer(); |
112 ASSERT_TRUE(m_platformLayer); | 112 ASSERT_TRUE(m_platformLayer); |
113 | 113 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 m_graphicsLayer->setScrollableArea(&scrollableArea, false); | 158 m_graphicsLayer->setScrollableArea(&scrollableArea, false); |
159 | 159 |
160 WebPoint scrollPosition(7, 9); | 160 WebPoint scrollPosition(7, 9); |
161 m_platformLayer->setScrollPosition(scrollPosition); | 161 m_platformLayer->setScrollPosition(scrollPosition); |
162 m_graphicsLayer->didScroll(); | 162 m_graphicsLayer->didScroll(); |
163 | 163 |
164 EXPECT_EQ(scrollPosition, WebPoint(scrollableArea.scrollPosition())); | 164 EXPECT_EQ(scrollPosition, WebPoint(scrollableArea.scrollPosition())); |
165 } | 165 } |
166 | 166 |
167 } // namespace | 167 } // namespace |
OLD | NEW |